/* Documentation: sidebar · article · table of contents, search dialog, engine tabs. */
.docs-page .site-main {
  min-height: 0;
}

/* The docs use the full width, so the header lines up with the sidebar. */
.docs-page .site-header__inner,
.docs-page .site-footer__inner {
  max-width: 1440px;
}

.docs {
  --docs-top: 64px;
  --docs-bar: 52px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1440px;
  margin: 0 auto;
}

/* Sidebar ------------------------------------------------------------------ */
.docs-sidebar {
  position: sticky;
  top: var(--docs-top);
  align-self: start;
  height: calc(100vh - var(--docs-top));
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding: var(--sp-5) var(--sp-4) var(--sp-6);
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.docs-sidebar:hover,
.docs-sidebar:focus-within {
  scrollbar-color: var(--border-strong) transparent;
}

.docs-search-trigger {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  height: 38px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text-3);
  font: inherit;
  font-size: var(--fs-14);
  text-align: left;
  cursor: pointer;
}

.docs-search-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text-2);
}

.docs-search-trigger span {
  flex: 1;
}

.docs-page kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text-2);
  font-size: 11px;
  line-height: 1;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

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

.docs-nav__title {
  margin: 0 0 var(--sp-1);
  padding: 0 10px;
  color: var(--text-2);
  font-size: var(--fs-13);
  font-weight: 600;
}

.docs-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: var(--fs-14);
  line-height: 1.35;
  text-decoration: none;
}

.docs-nav__link .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.docs-nav__link span:first-of-type {
  flex: 1;
  min-width: 0;
}

.docs-nav__link:hover {
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.docs-nav__link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.docs-nav__link[aria-current="page"] .icon {
  color: var(--accent-ink);
}

.docs-nav__star .icon {
  width: 13px;
  height: 13px;
  color: var(--warning);
}

.docs-sidebar__foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.docs-version {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: var(--fs-12);
  text-decoration: none;
}

.docs-version:hover {
  border-color: var(--border-strong);
  color: var(--text);
  text-decoration: none;
}

.docs-version__number {
  font-family: var(--font-mono);
  color: var(--text-3);
}

/* Bar above the article ----------------------------------------------------------- */
.docs-main {
  min-width: 0;
}

.docs-bar {
  position: sticky;
  top: var(--docs-top);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: var(--docs-bar);
  padding: 0 var(--sp-8);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.docs-bar__menu,
.docs-bar__search {
  display: none;
}

.docs-breadcrumb {
  min-width: 0;
  flex: 1;
}

.docs-breadcrumb ol {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-3);
  font-size: var(--fs-13);
  white-space: nowrap;
  overflow: hidden;
}

.docs-breadcrumb li + li::before {
  content: "/";
  margin: 0 var(--sp-2);
  color: var(--border-strong);
}

.docs-breadcrumb li:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-breadcrumb a {
  color: var(--text-2);
}

.docs-breadcrumb [aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* Article ------------------------------------------------------------------------ */
.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 224px;
  gap: var(--sp-12);
  padding: var(--sp-8) var(--sp-8) var(--sp-16);
}

.docs-article {
  min-width: 0;
  max-width: 780px;
}

.docs-article__header {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.docs-article__header h1 {
  margin: 0 0 var(--sp-3);
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.docs-lead {
  margin: 0;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.6;
}

.docs-lang-note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-3) 0 0;
  color: var(--text-3);
  font-size: var(--fs-13);
}

.docs-lang-note .icon {
  flex: none;
  width: 14px;
  height: 14px;
}

.docs-prose {
  font-size: 15px;
  line-height: 1.7;
}

.docs-prose > :first-child {
  margin-top: 0;
}

.docs-prose p,
.docs-prose ul,
.docs-prose ol {
  margin: 0 0 var(--sp-4);
}

.docs-prose ul,
.docs-prose ol {
  padding-left: 22px;
}

.docs-prose li + li {
  margin-top: 6px;
}

.docs-prose a:not(.docs-card):not(.btn):not(.docs-heading__anchor) {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 3px;
}

.docs-prose a:not(.docs-card):not(.btn):not(.docs-heading__anchor):hover {
  text-decoration-color: currentColor;
}

.docs-prose strong {
  font-weight: 650;
}

.docs-prose :not(pre) > code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-2);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.docs-heading {
  position: relative;
  scroll-margin-top: calc(var(--docs-top) + var(--docs-bar) + var(--sp-4));
}

.docs-prose h2.docs-heading {
  margin: var(--sp-12) 0 var(--sp-4);
  padding-top: var(--sp-2);
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.docs-prose h2.docs-heading:first-child {
  margin-top: 0;
}

.docs-prose h3.docs-heading {
  margin: var(--sp-8) 0 var(--sp-3);
  font-size: 18px;
  line-height: 1.35;
}

.docs-heading__anchor {
  margin-left: var(--sp-2);
  color: var(--text-3);
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.docs-heading:hover .docs-heading__anchor,
.docs-heading__anchor:focus-visible {
  opacity: 1;
}

.docs-heading__anchor:hover {
  color: var(--accent-ink);
  text-decoration: none;
}

.docs-steps {
  counter-reset: docs-step;
  list-style: none;
  padding-left: 0 !important;
}

.docs-steps > li {
  position: relative;
  padding-left: 40px;
  min-height: 28px;
}

.docs-steps > li + li {
  margin-top: var(--sp-3);
}

.docs-steps > li::before {
  counter-increment: docs-step;
  content: counter(docs-step);
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--text-2);
  font-size: var(--fs-16);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.docs-prose .callout {
  margin: var(--sp-5) 0;
  font-size: var(--fs-14);
  line-height: 1.6;
}

.docs-prose .callout p:last-child {
  margin-bottom: 0;
}

/* Cards ---------------------------------------------------------------------------- */
.docs-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-5) 0 var(--sp-6);
}

.docs-cards--compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.docs-card {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.docs-card:hover {
  border-color: var(--accent);
  background: var(--panel-2);
  text-decoration: none;
}

.docs-card__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
}

.docs-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-right: var(--sp-4);
}

.docs-card__title {
  font-weight: 650;
  font-size: var(--fs-14);
  line-height: 1.4;
}

.docs-card__body {
  color: var(--text-2);
  font-size: var(--fs-13);
  line-height: 1.5;
}

.docs-card__arrow {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-3);
  width: 16px;
  height: 16px;
  color: var(--text-3);
  transition: transform 0.15s ease, color 0.15s ease;
}

.docs-card:hover .docs-card__arrow {
  color: var(--accent-ink);
  transform: translateX(2px);
}

/* Code blocks and engine tabs ---------------------------------------------------------- */
.docs-code {
  margin: var(--sp-4) 0 var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  overflow: hidden;
}

.docs-code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.docs-code__tabs,
.docs-engines__tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.docs-code__tabs::-webkit-scrollbar,
.docs-engines__tabs::-webkit-scrollbar {
  display: none;
}

.docs-code__tab,
.docs-engines__tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.docs-code__tab:hover,
.docs-engines__tab:hover {
  color: var(--text);
}

.docs-code__tab[aria-selected="true"],
.docs-engines__tab[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent-ink);
}

.docs-code__title {
  padding-right: var(--sp-3);
  color: var(--text-3);
  font-size: var(--fs-12);
}

.docs-code__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 6px 6px 0 14px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.docs-code--single .docs-code__meta {
  padding-bottom: 0;
}

.docs-code__copy {
  min-height: 28px;
  padding: 0 8px;
  font-family: var(--font-ui);
}

.docs-code__copy .icon {
  width: 14px;
  height: 14px;
}

.docs-code pre {
  margin: 0;
  padding: 10px 16px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
}

.docs-code pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  white-space: pre;
}

.docs-engines {
  margin: var(--sp-4) 0 var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.docs-engines__tabs {
  border-bottom: 1px solid var(--border);
}

.docs-engines__tab .badge {
  padding: 0 6px;
  font-size: 10px;
}

.docs-engines__panel {
  padding: var(--sp-5) var(--sp-5) var(--sp-2);
}

.docs-engines__panel .docs-code {
  margin-top: 0;
}

/* Tables ------------------------------------------------------------------------------- */
.docs-table-wrap {
  margin: var(--sp-4) 0 var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-14);
  line-height: 1.55;
}

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

.docs-table thead th {
  background: var(--panel-2);
  color: var(--text-2);
  font-size: var(--fs-12);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.docs-table tbody tr:last-child > * {
  border-bottom: 0;
}

.docs-table td:first-child {
  white-space: nowrap;
}

.docs-table--errors td:nth-child(4) {
  min-width: 260px;
}

.docs-table--plans th[scope="row"] {
  color: var(--text-2);
  font-weight: 500;
}

.docs-table--plans td {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* REST endpoints ---------------------------------------------------------------------- */
.docs-endpoints {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}

.endpoint {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  scroll-margin-top: calc(var(--docs-top) + var(--docs-bar) + var(--sp-4));
}

.endpoint[open] {
  border-color: var(--border-strong);
}

.endpoint summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  padding: 10px 14px;
}

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

.endpoint__method {
  min-width: 58px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 700;
  text-align: center;
}

.endpoint__method--get { background: var(--link-soft); color: var(--link); }
.endpoint__method--post { background: var(--accent-soft); color: var(--accent-ink); }
.endpoint__method--put,
.endpoint__method--patch { background: var(--warning-soft); color: var(--warning-ink); }
.endpoint__method--delete { background: var(--danger-soft); color: var(--danger-ink); }

.endpoint__path {
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  font-size: var(--fs-13) !important;
  font-weight: 600;
}

.endpoint__summary {
  flex: 1 1 200px;
  color: var(--text-2);
  font-size: var(--fs-13);
}

.endpoint__chevron {
  width: 16px;
  height: 16px;
  color: var(--text-3);
  transition: transform 0.15s ease;
}

.endpoint[open] .endpoint__chevron {
  transform: rotate(180deg);
}

.endpoint__body {
  padding: var(--sp-2) 14px var(--sp-4);
  border-top: 1px solid var(--border);
}

.endpoint__label {
  margin: var(--sp-3) 0 var(--sp-1);
  color: var(--text-2);
  font-size: var(--fs-12);
  font-weight: 700;
}

.endpoint__params {
  margin: 0 !important;
  font-size: var(--fs-13);
}

.endpoint__json {
  margin: 0;
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.55;
}

.endpoint__json code {
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}

/* FAQ and downloads ------------------------------------------------------------------- */
.docs-faq {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}

.docs-faq__item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.docs-faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.docs-faq__item summary::-webkit-details-marker {
  display: none;
}

.docs-faq__chevron {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-3);
  transition: transform 0.15s ease;
}

.docs-faq__item[open] .docs-faq__chevron {
  transform: rotate(180deg);
}

.docs-faq__answer {
  padding: 0 16px 4px;
  color: var(--text-2);
}

.docs-downloads {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: var(--sp-4) 0 var(--sp-6);
}

.docs-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.docs-download__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.docs-download__name {
  font-weight: 650;
}

.docs-download__name a {
  color: var(--text) !important;
  text-decoration: none !important;
}

.docs-download__meta {
  color: var(--text-2);
  font-size: var(--fs-13);
}

/* Pager ----------------------------------------------------------------------------- */
.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-top: var(--sp-12);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

.docs-pager__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
}

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

.docs-pager__link--next {
  grid-column: 2;
  align-items: flex-end;
  text-align: right;
}

.docs-pager__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-3);
  font-size: var(--fs-12);
  font-weight: 600;
}

.docs-pager__label .icon {
  width: 14px;
  height: 14px;
}

.docs-pager__title {
  color: var(--accent-ink);
  font-weight: 650;
}

/* Table of contents ------------------------------------------------------------------ */
.docs-toc {
  position: sticky;
  top: calc(var(--docs-top) + var(--docs-bar) + var(--sp-8));
  align-self: start;
  max-height: calc(100vh - var(--docs-top) - var(--docs-bar) - var(--sp-12));
  overflow-y: auto;
  font-size: var(--fs-13);
  scrollbar-width: thin;
}

.docs-toc__title {
  margin-bottom: var(--sp-2);
  color: var(--text);
  font-size: var(--fs-14);
  font-weight: 600;
}

.docs-toc ul,
.docs-toc-mobile ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-toc ul {
  border-left: 1px solid var(--border);
}

.docs-toc__item a {
  display: block;
  padding: 4px 0 4px 12px;
  color: var(--text-2);
  line-height: 1.45;
  text-decoration: none;
}

.docs-toc ul a {
  margin-left: -1px;
  border-left: 2px solid transparent;
}

.docs-toc__item--3 a {
  padding-left: 24px;
  font-size: var(--fs-12);
}

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

.docs-toc__item a[aria-current="true"] {
  border-left-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.docs-toc__top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--sp-4);
  color: var(--text-3);
  font-size: var(--fs-12);
}

.docs-toc__top-icon {
  width: 13px;
  height: 13px;
  transform: rotate(-90deg);
}

.docs-toc-mobile {
  display: none;
  margin-top: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.docs-toc-mobile summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 14px;
  font-size: var(--fs-14);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.docs-toc-mobile summary::-webkit-details-marker {
  display: none;
}

.docs-toc-mobile__chevron {
  margin-left: auto;
  transition: transform 0.15s ease;
}

.docs-toc-mobile[open] .docs-toc-mobile__chevron {
  transform: rotate(180deg);
}

.docs-toc-mobile ul {
  padding: 0 14px 10px;
}

/* Search dialog ------------------------------------------------------------------------ */
.docs-search {
  width: min(640px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 96px));
  margin: 72px auto auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.docs-search::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(2px);
}

.docs-search__panel {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.docs-search__field {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-3) 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.docs-search__field > .icon {
  color: var(--text-3);
}

.docs-search__field input {
  flex: 1;
  min-width: 0;
  height: 56px;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.docs-search__field input::-webkit-search-cancel-button {
  display: none;
}

.docs-search__close {
  padding: 0 6px;
}

.docs-search__results {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2);
  overscroll-behavior: contain;
}

.docs-search__empty {
  margin: 0;
  padding: var(--sp-8) var(--sp-4);
  color: var(--text-3);
  text-align: center;
}

.docs-search__group {
  padding: var(--sp-2) var(--sp-3) var(--sp-1);
  color: var(--text-2);
  font-size: var(--fs-13);
  font-weight: 600;
}

.docs-search__result {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}

.docs-search__result .icon {
  flex: none;
  margin-top: 2px;
  color: var(--text-3);
}

.docs-search__result[aria-selected="true"] {
  background: var(--accent-soft);
  text-decoration: none;
}

.docs-search__result[aria-selected="true"] .icon {
  color: var(--accent-ink);
}

.docs-search__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.docs-search__title {
  font-weight: 600;
  font-size: var(--fs-14);
}

.docs-search__title span {
  color: var(--text-3);
  font-weight: 500;
}

.docs-search__snippet {
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-13);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.docs-search mark {
  padding: 0 1px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--warning) 35%, transparent);
  color: inherit;
}

.docs-search__foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  padding: 10px var(--sp-4);
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: var(--fs-12);
}

.docs-search__foot kbd {
  min-width: 20px;
  height: 20px;
  margin-right: 2px;
}

/* Responsive --------------------------------------------------------------------------- */
@media (max-width: 1240px) {
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }

  .docs-toc-mobile {
    display: block;
  }
}

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

  .docs-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-drawer);
    width: min(300px, 86vw);
    height: auto;
    border-right: 1px solid var(--border);
    background: var(--panel);
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    transition: transform 0.2s ease, visibility 0.2s;
    visibility: hidden;
  }

  .docs--nav-open .docs-sidebar {
    transform: none;
    visibility: visible;
  }

  .docs-backdrop {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-drawer) - 1);
    background: var(--backdrop);
  }

  .docs-bar {
    padding: 0 var(--gutter);
  }

  .docs-bar__menu,
  .docs-bar__search {
    display: inline-flex;
  }

  .docs-layout {
    padding: var(--sp-6) var(--gutter) var(--sp-12);
  }
}

@media (max-width: 640px) {
  /* The site header is 56px tall on phones; the docs bar sits right under it. */
  .docs {
    --docs-top: 56px;
  }

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

  .docs-prose {
    font-size: 15px;
  }

  .docs-prose h2.docs-heading {
    margin-top: var(--sp-10);
    font-size: 21px;
  }

  .docs-engines__panel {
    padding: var(--sp-4) var(--sp-4) var(--sp-1);
  }

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

  .docs-pager__link--next {
    grid-column: 1;
  }

  .docs-search {
    margin-top: 16px;
    max-height: calc(100vh - 32px);
  }

  .docs-search__foot {
    display: none;
  }

  .docs-breadcrumb li:not(:last-child) {
    display: none;
  }

  .docs-breadcrumb li + li::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs-sidebar,
  .docs-card,
  .docs-card__arrow {
    transition: none;
  }
}

/* Engine logos in tabs, cards and the sidebar. */
.docs-logo {
  width: 15px;
  height: 15px;
  margin-right: 2px;
}

.docs-code__tab[aria-selected="false"] .docs-logo,
.docs-engines__tab[aria-selected="false"] .docs-logo {
  opacity: 0.75;
}

.docs-card__icon--logo {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.docs-card__icon--logo .icon {
  width: 22px;
  height: 22px;
}
