/* The docs at /docs (GIT-159): three columns over the site's own tokens from site.css; no colour of its own. */

.docs-top .docs-bar {
  display: flex;
  align-items: center;
  gap: var(--s-s);
  max-width: 1440px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.docs-top .brand {
  margin-right: var(--s-l);
}
.docs-tabs {
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  margin-right: auto;
}
.docs-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--s-m);
  border-radius: var(--radius-button);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}
.docs-tabs a:hover {
  color: var(--text);
}
.docs-tabs a[aria-current='page'] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 0;
}
.docs-search-open {
  display: inline-flex;
  align-items: center;
  gap: var(--s-s);
  min-width: 220px;
  min-height: 40px;
  padding: 0 var(--s-s) 0 var(--s-m);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--surface);
  color: var(--text-faint);
  font: 400 0.875rem / 1 var(--font-ui);
  cursor: pointer;
}
.docs-search-open:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.docs-search-open svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.docs-search-open .label {
  margin-right: auto;
}
.docs kbd {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1;
}

.docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 720px) 220px;
  justify-content: center;
  gap: 0 var(--s-3xl);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.docs-menu {
  display: none;
}
.docs-sidebar {
  position: sticky;
  top: 65px;
  align-self: start;
  max-height: calc(100vh - 65px);
  overflow-y: auto;
  padding: var(--s-xl) var(--s-xs) var(--s-3xl) 0;
  scrollbar-width: thin;
}
.docs-section {
  margin: var(--s-xl) 0 var(--s-xs);
  padding-left: var(--s-m);
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.docs-section:first-child {
  margin-top: 0;
}
.docs-sidebar ul,
.docs-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.docs-sidebar a {
  display: block;
  padding: 5px var(--s-m);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.45;
}
.docs-sidebar a:hover {
  color: var(--text);
  background: var(--surface);
}
.docs-sidebar a[aria-current='page'] {
  color: var(--text);
  background: var(--surface-active);
  font-weight: 600;
}

.docs-main {
  min-width: 0;
  padding: var(--s-xl) 0 var(--s-3xl);
}
.docs-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-s) var(--s-m);
  margin-bottom: var(--s-s);
}
.docs-eyebrow {
  margin: 0 auto 0 0;
  color: var(--link);
  font: 400 0.8125rem / 1.4 var(--font-code);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.docs-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 var(--s-m);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--surface);
  color: var(--text-secondary);
  font: 600 0.8125rem / 1 var(--font-ui);
  cursor: pointer;
}
.docs-copy:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.docs-copy svg {
  width: 15px;
  height: 15px;
}
.docs-view-md {
  font-size: 0.8125rem;
  font-weight: 600;
}

.docs-content {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text);
}
.docs-content h1 {
  margin: 0 0 var(--s-l);
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.docs-content h2 {
  margin: var(--s-3xl) 0 var(--s-m);
  padding-top: var(--s-s);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.docs-content h3 {
  margin: var(--s-2xl) 0 var(--s-s);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}
.docs-content p,
.docs-content ul,
.docs-content ol {
  margin: 0 0 var(--s-l);
}
.docs-content ul,
.docs-content ol {
  padding-left: 1.4em;
}
.docs-content li + li {
  margin-top: 6px;
}
.docs-content a {
  font-weight: 600;
}
.docs-content strong {
  font-weight: 600;
}
.docs-content code {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
.docs-content pre {
  margin: 0 0 var(--s-l);
  padding: var(--s-l);
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--surface);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.docs-content pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}
.docs-content figure {
  margin: var(--s-xl) 0;
}
.docs-content figure img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  box-shadow: 0 12px 40px var(--shadow);
}
.docs-content .table {
  margin: 0 0 var(--s-xl);
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
}
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.docs-content th,
.docs-content td {
  padding: 8px var(--s-m);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.docs-content th {
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 600;
}
.docs-content tr:last-child td {
  border-bottom: 0;
}
.docs-content td code {
  white-space: nowrap;
}
.docs-content .callout {
  margin: 0 0 var(--s-l);
  padding: var(--s-m) var(--s-l);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}
.docs-content .callout > :last-child {
  margin-bottom: 0;
}
.docs-content .steps {
  display: grid;
  gap: var(--s-s);
  margin: 0 0 var(--s-xl);
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.docs-content .steps li {
  margin: 0;
  counter-increment: step;
}
.docs-content .steps a {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 2px var(--s-m);
  padding: var(--s-m) var(--s-l);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
  transition: border-color var(--fast) var(--ease);
}
.docs-content .steps a::before {
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-label);
  background: var(--primary-container);
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
}
.docs-content .steps a:hover {
  border-color: var(--accent);
}
.docs-content .steps span {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.docs-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-m);
  margin-top: var(--s-3xl);
  padding-top: var(--s-xl);
  border-top: 1px solid var(--border);
}
.docs-pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-m) var(--s-l);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.docs-pager a:hover {
  border-color: var(--accent);
}
.docs-pager span {
  color: var(--text-faint);
  font-size: 0.8125rem;
  font-weight: 400;
}
.docs-pager .next {
  grid-column: 2;
  text-align: right;
}

.docs-aside {
  min-width: 0;
}
.docs-toc {
  position: sticky;
  top: 65px;
  max-height: calc(100vh - 65px);
  overflow-y: auto;
  padding: var(--s-xl) 0;
}
.docs-toc-title {
  margin: 0 0 var(--s-s);
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.docs-toc a {
  display: block;
  padding: 4px 0 4px var(--s-m);
  border-left: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.docs-toc a:hover,
.docs-toc a[data-current] {
  color: var(--text);
  border-left-color: var(--accent);
}

.docs-search {
  width: min(640px, calc(100vw - 2 * var(--gutter)));
  max-height: min(560px, calc(100vh - 120px));
  margin: 10vh auto auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px var(--shadow);
  overflow: hidden;
}
.docs-search[open] {
  display: flex;
  flex-direction: column;
}
.docs-search::backdrop {
  background: color-mix(in srgb, var(--background) 70%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.docs-search-box {
  display: flex;
  align-items: center;
  gap: var(--s-s);
  padding: 0 var(--s-l);
  border-bottom: 1px solid var(--border);
  color: var(--text-faint);
}
.docs-search-box svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.docs-search-box input {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 400 1rem / 1.4 var(--font-ui);
}
.docs-search-box input::-webkit-search-cancel-button {
  display: none;
}
.docs-search-results {
  margin: 0;
  padding: var(--s-s);
  overflow-y: auto;
  list-style: none;
}
.docs-search-results:empty {
  display: none;
}
.docs-search-results a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px var(--s-m);
  padding: var(--s-s) var(--s-m);
  border-radius: var(--radius-small);
  color: var(--text);
  text-decoration: none;
}
.docs-search-results [aria-selected='true'] a {
  background: var(--surface-active);
}
.hit-title {
  font-weight: 600;
  font-size: 0.9375rem;
}
.hit-section {
  color: var(--text-faint);
  font-size: 0.75rem;
}
.hit-text {
  grid-column: 1 / -1;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.docs-search-note {
  margin: 0;
  padding: var(--s-l);
  color: var(--text-faint);
  font-size: 0.875rem;
}
.docs-search-note[hidden] {
  display: none;
}

@media (max-width: 1179px) {
  .docs-layout {
    grid-template-columns: 220px minmax(0, 720px);
    gap: 0 var(--s-2xl);
  }
  .docs-aside {
    display: none;
  }
}

@media (max-width: 899px) {
  .docs-layout {
    display: block;
  }
  .docs-menu {
    display: inline-flex;
    align-items: center;
    gap: var(--s-s);
    min-height: 48px;
    margin-top: var(--s-s);
    padding: 0 var(--s-m);
    border: 1px solid var(--border);
    border-radius: var(--radius-button);
    background: var(--surface);
    color: var(--text);
    font: 600 0.875rem / 1 var(--font-ui);
    cursor: pointer;
  }
  .docs-menu svg {
    width: 18px;
    height: 18px;
  }
  .docs-sidebar {
    position: static;
    max-height: none;
    margin-top: var(--s-s);
    padding: var(--s-m);
    border: 1px solid var(--border);
    border-radius: var(--radius-button);
    background: var(--surface);
  }
  .docs-sidebar:not([data-open]) {
    display: none;
  }
  .docs-search-open {
    min-width: 0;
  }
  .docs-search-open .label,
  .docs-search-open kbd {
    display: none;
  }
}

@media (max-width: 599px) {
  .docs-top .brand {
    margin-right: 0;
  }
  .docs-tabs a {
    padding: 0 var(--s-s);
  }
  .docs-search-open {
    min-height: 44px;
    padding: 0 var(--s-m);
  }
  .docs-pager {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-pager .next {
    grid-column: 1;
  }
}
