/* Two-column docs shell for /developers/ */
/* Layered on top of /product/style.css which provides nav + footer + base body */

/* product/style.css sets `body { overflow-x: hidden }` which can pin sticky
   elements to the body scroll container in surprising ways. On docs pages
   the html element is the scroll container; clear body overflow so sticky
   sidebars track the viewport. */
html, body { overflow-x: visible; }

.docs-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1240px;
  margin: 0;
  padding-top: 90px;
  gap: 0;
}

.docs-sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 24px 12px 40px 24px;
  border-right: 1px solid rgba(255,255,255,0.06);
  font-size: 13.5px;
}
/* product/style.css has a global `nav { position: fixed; top: 0; ... }` rule
   intended for the page-top nav. It cascades onto the inner <nav> we use
   inside the sidebar, ripping it out of the grid. Reset every property the
   global rule touches. */
.docs-sidebar nav {
  position: static;
  top: auto; left: auto; right: auto; z-index: auto;
  padding: 0; margin: 0;
  background: none; backdrop-filter: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 1px;
}
.docs-sidebar nav a {
  display: block;
  padding: 5px 12px;
  color: #86868b;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
  font-size: 13.5px;
  font-weight: 500;
}
.docs-sidebar nav a:hover { color: #f5f5f7; background: rgba(255,255,255,0.04); }
/* Top-level page link (Overview, CLI, Automation, HTTP API, Gateway) */
.docs-sidebar nav a.page {
  font-weight: 600;
  color: #f5f5f7;
  margin-top: 14px;
}
.docs-sidebar nav a.page:first-of-type { margin-top: 0; }
.docs-sidebar nav a.page.current {
  background: rgba(41,151,255,0.18);
}
/* h2 anchor under a page */
.docs-sidebar nav a.h2 {
  padding-left: 26px;
  font-size: 13px;
  font-weight: 400;
  color: #86868b;
}
/* h3 anchor (only rendered for the current page) */
.docs-sidebar nav a.h3 {
  padding-left: 40px;
  font-size: 12.5px;
  font-weight: 400;
  color: #6e6e73;
}
/* Section currently scrolled into view (set by IntersectionObserver) */
.docs-sidebar nav a.in-view {
  color: #f5f5f7;
  background: rgba(41,151,255,0.14);
}

.docs-main {
  padding: 28px 40px 100px;
  max-width: 880px;
  font-size: 15px;
  line-height: 1.65;
  color: #c7c7cc;
}

.docs-main h1 {
  font-size: 36px; font-weight: 700; letter-spacing: -0.02em;
  color: #f5f5f7;
  margin-bottom: 8px;
}
.docs-main .lede {
  font-size: 17px; color: #a1a1a6;
  margin: 0 0 36px;
  line-height: 1.55;
}
.docs-main h2 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  color: #f5f5f7;
  margin-top: 56px; margin-bottom: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  scroll-margin-top: 80px;
}
.docs-main h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.docs-main h3 {
  font-size: 12px; font-weight: 600;
  color: #2997ff;
  margin: 32px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  scroll-margin-top: 80px;
}

.docs-main p { color: #c7c7cc; margin-bottom: 14px; }
.docs-main ul, .docs-main ol {
  color: #c7c7cc; padding-left: 22px; margin: 6px 0 18px;
}
.docs-main li { margin-bottom: 6px; line-height: 1.55; }

.docs-main code {
  font-family: 'SF Mono', ui-monospace, 'Menlo', 'Consolas', monospace;
  font-size: 90%;
  color: #d2d2d7;
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 4px;
}
.docs-main pre {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: 'SF Mono', ui-monospace, 'Menlo', 'Consolas', monospace;
  font-size: 13.5px;
  line-height: 1.55;
  color: #d2d2d7;
  margin: 16px 0 24px;
}
.docs-main pre code {
  background: none; padding: 0; border-radius: 0; font-size: inherit; color: inherit;
}
.docs-main pre .c { color: #6e6e73; }
.docs-main pre .k { color: #2997ff; }
.docs-main pre .s { color: #a4d8a4; }

.docs-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 24px;
  font-size: 14px;
}
.docs-main table th, .docs-main table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.docs-main table th {
  font-weight: 600;
  color: #f5f5f7;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom-color: rgba(255,255,255,0.14);
}
.docs-main table td { color: #a1a1a6; }
.docs-main table td:first-child {
  font-family: 'SF Mono', ui-monospace, 'Menlo', 'Consolas', monospace;
  color: #f5f5f7;
  font-size: 13px;
  white-space: nowrap;
  font-weight: 500;
}
.docs-main table.routes td.method {
  color: #2997ff;
  font-family: 'SF Mono', ui-monospace, 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  font-weight: 600;
  width: 110px;
  white-space: nowrap;
}
.docs-main table.routes td.method.post { color: #f6ad55; }
.docs-main table.routes td.method.put { color: #b484ff; }
.docs-main table.routes td.method.delete { color: #ff7a7a; }
.docs-main table.routes td.path {
  font-family: 'SF Mono', ui-monospace, 'Menlo', 'Consolas', monospace;
  color: #f5f5f7;
  font-size: 13px;
  white-space: nowrap;
  font-weight: 500;
}

.docs-main .arch-diagram {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 20px;
  margin: 12px 0 24px;
  overflow-x: auto;
}
.docs-main .arch-diagram pre {
  background: none; border: none; padding: 0; margin: 0;
  font-size: 12px; line-height: 1.5;
  white-space: pre;
}
.docs-main .arch-diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Standard logo placed alongside an h3 (passkey, WASM, PWA, etc.). */
.docs-main .section-icon {
  float: right;
  height: 52px;
  width: auto;
  max-width: 160px;
  margin: -6px 0 12px 28px;
  opacity: 0.92;
}
@media (max-width: 700px) {
  .docs-main .section-icon {
    float: none;
    display: block;
    margin: 8px 0 16px;
  }
}

/* Hub page — list of pages */
.docs-index { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.docs-index a {
  display: block;
  padding: 18px 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.docs-index a:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
}
.docs-index .name {
  display: block;
  font-size: 16px; font-weight: 600;
  color: #f5f5f7;
  margin-bottom: 4px;
}
.docs-index .desc {
  display: block;
  font-size: 14px; color: #86868b;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; padding-top: 72px; }
  .docs-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 14px 16px;
  }
  .docs-main { padding: 24px 18px 60px; max-width: 100%; }
  .docs-main h1 { font-size: 28px; }
  .docs-main h2 { font-size: 19px; margin-top: 36px; }
}
