.docs-page {
  --docs-bg: #f7f8f5;
  --docs-surface: #ffffff;
  --docs-sidebar: #f1f3ef;
  --docs-text: #111411;
  --docs-muted: #586159;
  --docs-border: #d8ddd6;
  --docs-accent: #597065;
  --docs-code: #121512;
  background: var(--docs-bg);
  color: var(--docs-text);
  font-size: 15px;
}

.docs-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  min-height: 56px;
  padding: 0 22px;
  align-items: center;
  border-bottom: 1px solid var(--docs-border);
  background: rgba(255, 255, 255, 0.97);
  gap: 28px;
  grid-template-columns: auto minmax(280px, 560px) 1fr;
  backdrop-filter: blur(14px);
}

.docs-header-brand {
  display: flex;
  align-items: center;
  color: var(--docs-text);
  font-size: 14px;
  gap: 9px;
  white-space: nowrap;
}

.docs-header-product {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.docs-header-product img {
  width: 24px;
  height: 24px;
  filter: invert(1);
}

.docs-header-product strong {
  font-weight: 690;
}

.docs-header-divider {
  color: #a2a8a2;
}

.docs-header-title {
  font-weight: 570;
}

.docs-header .docs-version {
  display: inline-flex;
  min-height: 22px;
  padding: 0 7px;
  align-items: center;
  justify-self: auto;
  border: 1px solid var(--docs-border);
  color: #687068;
  font-size: 10px;
  font-weight: 630;
}

.docs-header .docs-search-wrap {
  width: 100%;
}

.docs-search-toggle {
  display: none;
}

.docs-header .docs-search {
  display: grid;
  height: 36px;
  padding: 0 10px 0 13px;
  align-items: center;
  border: 1px solid #cdd2cb;
  background: #f7f8f5;
  color: #676e67;
  grid-template-columns: 18px 1fr auto;
}

.docs-header .docs-search:focus-within {
  border-color: #75887e;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(117, 136, 126, 0.12);
}

.docs-header .docs-search input {
  width: 100%;
  padding: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--docs-text);
  font: inherit;
  font-size: 13px;
}

.docs-header .docs-search kbd {
  min-width: 23px;
  padding: 2px 7px;
  border: 1px solid var(--docs-border);
  background: #fff;
  color: #727972;
  font-family: inherit;
  font-size: 10px;
  text-align: center;
}

.docs-header-links {
  display: flex;
  justify-self: end;
  gap: 24px;
}

.docs-header-links a {
  color: #4f574f;
  font-size: 12px;
}

.docs-header-links a:hover {
  color: var(--docs-text);
}

.docs-header > .docs-index-toggle {
  display: none;
}

.docs-search-results {
  top: calc(100% + 7px);
}

.docs-layout {
  display: grid;
  width: min(100%, 1240px);
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  align-items: stretch;
  gap: 0;
  grid-template-columns: 246px minmax(0, 920px);
}

.docs-sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  max-height: none;
  padding: 31px 20px 60px 22px;
  overflow-y: auto;
  border-right: 1px solid var(--docs-border);
  background: var(--docs-sidebar);
}

.docs-index {
  display: grid;
  padding: 0;
  gap: 1px;
}

.docs-index p {
  margin: 25px 0 8px;
  color: #7a837b;
  font-size: 9px;
  font-weight: 680;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.docs-index p:first-child {
  margin-top: 0;
}

.docs-index a {
  position: relative;
  padding: 6px 9px 6px 13px;
  color: #515a52;
  font-size: 13px;
  line-height: 1.35;
}

.docs-index a::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 0;
  width: 2px;
  background: transparent;
  content: "";
}

.docs-index a:hover,
.docs-index a.is-active {
  color: var(--docs-text);
}

.docs-index a.is-active::before {
  background: var(--docs-accent);
}

.docs-content {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: var(--docs-surface);
}

.docs-intro,
.docs-section {
  padding-right: 64px;
  padding-left: 64px;
}

.docs-intro {
  display: block;
  min-height: 0;
  padding-top: 46px;
  padding-bottom: 58px;
  overflow: visible;
  border-bottom: 1px solid var(--docs-border);
  background: var(--docs-surface);
  background-image: none;
}

.docs-intro::after {
  display: none;
}

.docs-breadcrumb {
  margin: 0 0 17px;
  color: #758078;
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-intro h1 {
  width: auto;
  max-width: 720px;
  margin: 0;
  font-size: 34px;
  font-weight: 610;
  line-height: 1.12;
}

.docs-lead {
  max-width: 680px;
  margin: 12px 0 24px;
  color: var(--docs-muted);
  font-size: 16px;
  line-height: 1.55;
}

.docs-start-command {
  margin: 0 0 12px;
}

.docs-start-command pre {
  padding-top: 14px;
  padding-bottom: 14px;
}

.docs-start-source {
  margin: 0;
}

.docs-start-source pre {
  max-height: none;
  padding-top: 17px;
  padding-bottom: 19px;
  font-size: 12.5px;
  line-height: 1.55;
}

.docs-start-result {
  display: grid;
  min-height: 43px;
  padding: 0 13px;
  align-items: center;
  border: 1px solid var(--docs-border);
  border-top: 0;
  background: #f3f5f1;
  color: #525b53;
  font-size: 11px;
  gap: 16px;
  grid-template-columns: auto 1fr auto;
}

.docs-start-result > code {
  justify-self: start;
  border: 0 !important;
  background: transparent !important;
  color: #26342d;
}

.docs-start-result strong {
  color: #65756c;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-section {
  padding-top: 62px;
  padding-bottom: 62px;
  scroll-margin-top: 56px;
  border-bottom: 1px solid var(--docs-border);
}

.docs-heading {
  max-width: 710px;
  margin-bottom: 27px;
}

.docs-kicker {
  margin-bottom: 12px;
  color: #67796e;
  font-size: 10px;
}

.docs-heading h2 {
  margin: 0;
  font-size: 29px;
  font-weight: 610;
  line-height: 1.15;
}

.docs-heading > p:last-child,
.docs-heading > div > p:last-child {
  margin-top: 12px;
  color: var(--docs-muted);
  font-size: 14px;
  line-height: 1.6;
}

.docs-page code,
.docs-page pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.docs-page :not(pre) > code {
  padding: 0.12em 0.3em;
  border: 1px solid var(--docs-border);
  background: #f1f3ef;
  font-size: 0.88em;
}

.docs-code {
  position: relative;
  border: 1px solid #2a302c;
  background: var(--docs-code);
  color: #e9ece7;
  box-shadow: none;
  clip-path: polygon(
    5px 0,
    calc(100% - 5px) 0,
    100% 5px,
    100% calc(100% - 5px),
    calc(100% - 5px) 100%,
    5px 100%,
    0 calc(100% - 5px),
    0 5px
  );
}

.docs-code pre {
  scrollbar-color: #59635c var(--docs-code);
  scrollbar-width: thin;
}

.docs-code-head {
  display: flex;
  min-height: 36px;
  padding: 0 10px 0 14px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #323732;
  color: #98a49c;
  font-size: 10px;
  font-weight: 620;
}

.docs-code-copy {
  min-width: 48px;
  min-height: 26px;
  border: 1px solid #444a44;
  background: transparent;
  color: #d9ddd7;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
}

.docs-code pre {
  max-width: 100%;
  margin: 0;
  padding: 19px 21px 22px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.65;
}

.docs-code-compact pre {
  min-height: 180px;
}

.docs-note {
  grid-template-columns: 145px 1fr;
}

.docs-columns {
  gap: 30px;
  grid-template-columns: 1.2fr 0.8fr;
}

.docs-project-grid {
  grid-template-columns: 0.7fr 1.3fr;
}

.docs-language-grid article {
  min-height: 186px;
}

.docs-language-grid h3 {
  margin-top: 31px;
}

.docs-data-flow div {
  min-height: 104px;
}

.docs-data-flow strong {
  margin-top: 33px;
}

.docs-mode-row {
  min-height: 74px;
  grid-template-columns: 90px 225px 1fr;
}

.docs-command-list div {
  min-height: 70px;
}

.docs-api-controls {
  display: flex;
  margin-bottom: 0;
  align-items: stretch;
  flex-direction: column;
  gap: 12px;
}

.docs-api-filters {
  display: flex;
  margin: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--docs-border);
  gap: 20px;
}

.docs-api-search {
  width: 250px;
}

.docs-api-filters button {
  position: relative;
  min-height: 39px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #606960;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  white-space: nowrap;
}

.docs-api-filters button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.docs-api-filters button:hover,
.docs-api-filters button.is-active {
  border: 0;
  background: transparent;
  color: var(--docs-text);
}

.docs-api-filters button.is-active::after {
  background: var(--docs-accent);
}

.docs-api-layout {
  display: grid;
  height: min(620px, calc(100vh - 120px));
  min-height: 520px;
  border: 0;
  border-bottom: 1px solid var(--docs-border);
  background: var(--docs-surface);
  grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1.28fr);
}

.docs-api-layout.is-sparse {
  height: auto;
  min-height: 330px;
}

.docs-api-layout.is-sparse .docs-api-list,
.docs-api-layout.is-sparse .docs-api-detail {
  min-height: 330px;
}

.docs-api-list {
  overflow-y: auto;
  border-right: 1px solid var(--docs-border);
}

.docs-api-list button {
  display: grid;
  width: 100%;
  min-height: 48px;
  padding: 9px 13px;
  align-content: center;
  border: 0;
  border-bottom: 1px solid #eceeea;
  background: transparent;
  color: var(--docs-text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  gap: 2px;
}

.docs-api-list button:hover,
.docs-api-list button.is-active {
  background: #f1f3ef;
}

.docs-api-list button.is-active {
  box-shadow: inset 2px 0 var(--docs-accent);
}

.docs-api-list strong {
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 580;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-api-list span {
  color: #7a827a;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-api-detail {
  padding: 34px 30px;
  overflow-y: auto;
}

.docs-api-detail h3 {
  margin: 16px 0 18px;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 21px;
  font-weight: 590;
}

.docs-api-detail pre {
  margin: 0 0 22px;
  padding: 16px;
  overflow: auto;
  border: 1px solid #252b27;
  background: var(--docs-code);
  color: #e6ebe7;
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.docs-api-detail p {
  color: var(--docs-muted);
  font-size: 14px;
  line-height: 1.65;
}

.docs-status {
  background: #eef1ec;
  background-image: none;
}

.docs-status-grid {
  margin: 30px 0;
}

.docs-footer {
  border-top: 0;
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 900px) {
  .docs-header {
    min-height: 56px;
    padding: 0 16px;
    gap: 16px;
    grid-template-columns: auto minmax(180px, 1fr) auto;
  }

  .docs-header-links {
    display: none;
  }

  .docs-header > .docs-index-toggle {
    display: inline-flex;
    min-height: 34px;
    padding: 0 9px;
    align-items: center;
    border: 1px solid var(--docs-border);
    background: transparent;
    color: var(--docs-text);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    gap: 7px;
  }

  .docs-header > .docs-index-toggle span {
    font-size: 16px;
    transition: transform 180ms ease;
  }

  .docs-header > .docs-index-toggle[aria-expanded="true"] span {
    transform: rotate(45deg);
  }

  .docs-layout {
    display: block;
    width: 100%;
  }

  .docs-sidebar {
    position: fixed;
    z-index: 35;
    top: 56px;
    bottom: 0;
    left: 0;
    display: none;
    width: min(310px, 86vw);
    height: auto;
    padding: 25px 20px;
    border-right: 1px solid var(--docs-border);
    box-shadow: 22px 0 55px rgba(17, 20, 17, 0.12);
  }

  .docs-sidebar:has(.docs-index.is-open) {
    display: block;
  }

  .docs-index.is-open {
    display: grid;
    max-height: none;
    padding: 0;
  }

  .docs-content {
    width: min(100%, 920px);
    margin: 0 auto;
    border: 0;
  }

  .docs-intro,
  .docs-section {
    padding-right: 40px;
    padding-left: 40px;
  }

  .docs-intro {
    padding-top: 40px;
  }
}

@media (max-width: 620px) {
  .docs-header {
    padding: 0 12px;
    gap: 9px;
    grid-template-columns: auto 1fr auto auto;
  }

  .docs-header-brand,
  .docs-header-product {
    gap: 6px;
  }

  .docs-header-product img {
    width: 22px;
    height: 22px;
  }

  .docs-header-divider,
  .docs-header .docs-version {
    display: none;
  }

  .docs-header .docs-search-wrap {
    position: static;
    width: auto;
  }

  .docs-search-toggle {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--docs-border);
    background: transparent;
    color: var(--docs-text);
    cursor: pointer;
    font: inherit;
  }

  .docs-header .docs-search {
    display: none;
  }

  .docs-header .docs-search-wrap.is-open .docs-search {
    position: absolute;
    z-index: 3;
    top: 9px;
    right: 88px;
    left: 12px;
    display: grid;
    width: auto;
    height: 38px;
    background: #fff;
    grid-template-columns: 16px 1fr;
  }

  .docs-header .docs-search-wrap.is-open .docs-search input {
    min-width: 0;
    padding-left: 7px;
    font-size: 13px;
  }

  .docs-header .docs-search kbd {
    display: none;
  }

  .docs-header .docs-search-results {
    position: fixed;
    top: 56px;
    right: 0;
    left: 0;
    max-height: calc(100vh - 56px);
    border-right: 0;
    border-left: 0;
  }

  .docs-header > .docs-index-toggle {
    padding-inline: 8px;
  }

  .docs-intro,
  .docs-section {
    padding-right: 20px;
    padding-left: 20px;
  }

  .docs-intro {
    padding-top: 28px;
    padding-bottom: 44px;
  }

  .docs-intro h1 {
    max-width: 100%;
    font-size: 28px;
  }

  .docs-lead {
    margin-bottom: 20px;
    font-size: 14px;
  }

  .docs-start-command,
  .docs-start-source {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  .docs-start-source pre {
    font-size: 11.5px;
  }

  .docs-code.is-code-overflowing:not(.is-code-at-end)::after {
    position: absolute;
    z-index: 2;
    top: 36px;
    right: 0;
    bottom: 0;
    width: 34px;
    background: linear-gradient(90deg, rgba(18, 21, 18, 0), var(--docs-code));
    content: "";
    pointer-events: none;
  }

  .docs-code.is-code-overflowing .docs-code-head > span::after {
    margin-left: 8px;
    color: #748079;
    content: "· swipe code →";
    font-size: 8px;
    letter-spacing: 0.03em;
  }

  .docs-start-result {
    padding: 9px 11px;
    gap: 5px 12px;
    grid-template-columns: auto 1fr;
  }

  .docs-start-result strong {
    grid-column: 1 / -1;
  }

  .docs-section {
    padding-top: 50px;
    padding-bottom: 50px;
  }

  .docs-heading h2 {
    font-size: 25px;
  }

  .docs-code:not(.docs-start-command):not(.docs-start-source) {
    margin-right: -20px;
    margin-left: -20px;
    clip-path: none;
  }

  .docs-columns,
  .docs-project-grid,
  .docs-language-grid,
  .docs-command-list,
  .docs-status-grid {
    grid-template-columns: 1fr;
  }

  .docs-columns > *,
  .docs-project-grid > *,
  .docs-language-grid > *,
  .docs-command-list > * {
    min-width: 0;
  }

  .docs-response {
    padding: 24px 0 0;
    border-top: 1px solid var(--docs-border);
    border-left: 0;
  }

  .docs-data-flow {
    grid-template-columns: 1fr 1fr;
  }

  .docs-data-flow i {
    display: none;
  }

  .docs-command-list div,
  .docs-command-list div:nth-child(even) {
    padding: 15px 0;
    border-right: 0;
  }

  .docs-mode-row {
    grid-template-columns: 78px 1fr;
  }

  .docs-mode-head {
    display: none;
  }

  .docs-mode-row p {
    grid-column: 1 / -1;
  }

  .docs-api-search {
    width: 100%;
  }

  .docs-api-filters {
    gap: 17px;
  }

  .docs-api-layout {
    height: auto;
    grid-template-columns: 1fr;
  }

  .docs-api-list {
    max-height: 270px;
    border-right: 0;
    border-bottom: 1px solid var(--docs-border);
  }

  .docs-api-detail {
    min-height: 320px;
    padding: 24px 18px;
  }

  .docs-status-grid div,
  .docs-status-grid div + div {
    min-height: 70px;
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid #c6cbc3;
  }
}

/* Mobile documentation controls retain their position while panels open. */
@media (max-width: 620px) {
  body.docs-index-open {
    overflow: hidden;
  }

  body.docs-search-open .docs-layout {
    padding-top: 62px;
  }

  .docs-header {
    min-height: 60px;
    padding: 0 12px;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 40px 86px;
  }

  .docs-header-brand {
    min-width: 0;
    overflow: hidden;
  }

  .docs-header-product,
  .docs-header-title {
    flex: 0 0 auto;
  }

  .docs-header-title {
    display: inline;
  }

  .docs-header .docs-search-wrap {
    position: static;
    width: 40px;
  }

  .docs-search-toggle {
    width: 40px;
    height: 40px;
    border-color: #cbd0c9;
    background: #fff;
    font-size: 19px;
  }

  .docs-search-wrap.is-open .docs-search-toggle {
    border-color: #87948c;
    background: #edf1ec;
  }

  .docs-header .docs-search-wrap.is-open .docs-search {
    position: fixed;
    z-index: 43;
    top: 60px;
    right: 0;
    left: 0;
    display: grid;
    width: 100%;
    height: 62px;
    padding: 10px 16px;
    border: 0;
    border-bottom: 1px solid var(--docs-border);
    background: #fff;
    box-shadow: 0 14px 30px rgba(17, 20, 17, 0.1);
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .docs-header .docs-search-wrap.is-open .docs-search input {
    padding-left: 8px;
    font-size: 16px;
  }

  .docs-header .docs-search-results {
    position: fixed;
    z-index: 44;
    top: 122px;
    right: 0;
    left: 0;
    max-height: calc(100dvh - 122px);
    border: 0;
    border-bottom: 1px solid var(--docs-border);
    box-shadow: 0 24px 40px rgba(17, 20, 17, 0.14);
  }

  .docs-header > .docs-index-toggle {
    width: 86px;
    min-width: 86px;
    min-height: 40px;
    padding: 0 10px;
    justify-content: center;
    background: #fff;
    white-space: nowrap;
  }

  .docs-index-label {
    display: inline-block;
    transform: none !important;
  }

  .docs-sidebar {
    z-index: 42;
    top: 60px;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: none;
    height: auto;
    padding: 24px 20px 54px;
    border: 0;
    background: var(--docs-sidebar);
    box-shadow: none;
  }

  .docs-index.is-open {
    width: min(100%, 480px);
    margin: 0 auto;
  }

  .docs-search-toggle > span[aria-hidden],
  .docs-search > span[aria-hidden] {
    position: relative;
    display: block;
    width: 14px;
    height: 14px;
    font-size: 0;
  }

  .docs-search-toggle > span[aria-hidden]::before,
  .docs-search > span[aria-hidden]::before {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 8px;
    height: 8px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    content: "";
  }

  .docs-search-toggle > span[aria-hidden]::after,
  .docs-search > span[aria-hidden]::after {
    position: absolute;
    right: 1px;
    bottom: 2px;
    width: 5px;
    height: 1.5px;
    background: currentColor;
    content: "";
    transform: rotate(45deg);
    transform-origin: right center;
  }
}
