/* /docs reading layout. Theme tokens come from app.css and public.css. */
.docs-page.page-wrap {
  max-width: 1180px;
  padding: 48px 24px 88px;
}

.docs-page .breadcrumb { margin-bottom: 20px; }
.docs-header { max-width: 880px; margin-bottom: 32px; }
.docs-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font: 600 11px/1.5 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.docs-header h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -.035em;
}
.docs-header > p:not(.docs-kicker) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}
.docs-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}
.docs-meta > span {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}
.docs-meta a { font-weight: 500; }
.docs-meta code { font-size: 11px; }

.docs-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  align-items: start;
  gap: 44px;
}
.docs-sidebar {
  position: sticky;
  top: 94px;
  max-height: calc(100dvh - 118px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.docs-nav { display: flex; flex-direction: column; gap: 3px; }
.docs-nav-label {
  margin: 0 0 10px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.docs-nav a {
  display: block;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  transition: background .15s, color .15s;
}
.docs-nav a:hover {
  background: var(--surface-2);
  color: var(--txt);
  text-decoration: none;
}
.docs-nav a.active,
.docs-nav a[aria-current="location"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.docs-content,
.docs-section,
.docs-details-body { min-width: 0; }
.docs-content { overflow-wrap: anywhere; }
.docs-content [id] { scroll-margin-top: 92px; }
.docs-section + .docs-section {
  margin-top: 54px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.docs-section > h2 {
  margin: 0 0 14px;
  color: var(--txt);
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -.025em;
}
.docs-section h3 {
  margin: 28px 0 10px;
  color: var(--txt);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.docs-content.prose p,
.docs-content.prose li {
  font-size: 14px;
  line-height: 1.85;
}
.docs-content p { margin: 10px 0 16px; }
.docs-content ul,
.docs-content ol { padding-left: 21px; }
.docs-content.prose li { margin: 6px 0; }
.docs-content p:last-child,
.docs-content ul:last-child,
.docs-content ol:last-child { margin-bottom: 0; }
.docs-content .docs-intro { margin-bottom: 22px; font-size: 15px; }
.docs-content a:not(.btn) { text-underline-offset: 3px; }
.docs-content code { font-size: .86em; }

.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.docs-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.docs-card h3 { margin: 0 0 10px; font-size: 16px; }
.docs-card p { margin: 0 0 14px; }
.docs-card .code-block { margin: 16px 0; }
.docs-card .btn { margin-top: 6px; }
.docs-note {
  margin: 20px 0;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.docs-note p { margin: 0; }
.docs-note p + p { margin-top: 8px; }
.docs-note strong { color: var(--txt); }
.docs-note-warning { border-left-color: var(--warn); }
.docs-endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.docs-method {
  flex: none;
  color: var(--ok);
  font: 700 11px/1.6 var(--mono);
  letter-spacing: .04em;
}
.docs-endpoint > code {
  min-width: 0;
  padding: 0;
  background: none;
  color: var(--txt);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.docs-content .docs-caption {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}
.docs-inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 18px 0;
  font-size: 13px;
}
.docs-code-label {
  display: block;
  margin: 20px 0 8px;
  color: var(--muted);
  font: 500 12px/1.5 var(--mono);
}

/* Keep wide reference material inside its own scrolling region. */
.docs-table-wrap {
  min-width: 0;
  max-width: 100%;
  margin: 18px 0;
  border-radius: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
.docs-table-wrap table { min-width: 560px; font-size: 15px; }
.docs-table-wrap caption {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
}
.docs-table-wrap th {
  padding: 12px 14px;
  color: var(--txt);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: top;
  white-space: nowrap;
}
.docs-table-wrap tbody th { font-size: 15px; }
.docs-table-wrap td {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 15px;
  vertical-align: top;
  line-height: 1.75;
}
.docs-table-wrap td:first-child { color: var(--txt); }
.docs-table-wrap code { font-size: 14px; white-space: nowrap; }
.docs-table-wrap td:first-child code { color: var(--accent); }
.docs-content .code-block,
.docs-content .code-tabs {
  max-width: 100%;
  margin: 18px 0;
  border-radius: 8px;
}
.docs-content .code-block { padding: 0; overflow: hidden; }
.docs-content .code-block pre {
  max-width: 100%;
  padding: 46px 18px 18px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  color: #d5dbf2;
  font: 400 12px/1.8 var(--mono);
  tab-size: 2;
  scrollbar-width: thin;
}
.docs-content .code-block pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  overflow-wrap: normal;
  white-space: pre;
}
.docs-content .code-tabs .code-block { margin: 0; border-radius: 0; }
.docs-content .code-block .copy-btn { top: 9px; right: 10px; font-size: 11px; }
.docs-content .code-block:not([data-copy]) pre { padding-top: 18px; }

.docs-details {
  min-width: 0;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.docs-details > summary {
  padding: 16px 18px;
  color: var(--txt);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  cursor: pointer;
}
.docs-details > summary::marker { color: var(--muted); font-size: .8em; }
.docs-details > summary:hover { color: var(--accent); }
.docs-details[open] > summary { border-bottom: 1px solid var(--border); }
.docs-details-body { padding: 4px 18px 18px; }
.docs-details-body > :last-child { margin-bottom: 0; }
.docs-details-body h3:first-child { margin-top: 18px; }
.docs-details .docs-table-wrap { margin-top: 14px; }
.docs-details .docs-details {
  background: transparent;
  border-color: var(--border-strong);
}
.docs-page :is(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 1020px) {
  .docs-layout { grid-template-columns: 174px minmax(0, 1fr); gap: 28px; }
  .docs-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .docs-page.page-wrap { padding: 32px 20px 64px; }
  .docs-page .breadcrumb { margin-bottom: 22px; }
  .docs-header { margin-bottom: 28px; }
  .docs-header > p:not(.docs-kicker) { font-size: 15px; }
  .docs-layout { display: block; }
  .docs-sidebar {
    position: static;
    max-height: none;
    margin: 0 0 32px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .docs-nav {
    flex-direction: row;
    align-items: center;
    gap: 5px;
    padding: 4px 2px 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }
  .docs-nav-label { display: none; }
  .docs-nav a { flex: 0 0 auto; padding: 7px 10px; white-space: nowrap; }
  .docs-section + .docs-section { margin-top: 40px; padding-top: 30px; }
  .docs-section > h2 { font-size: 23px; }
  .docs-content [id] { scroll-margin-top: 84px; }
}

@media (max-width: 480px) {
  /* This stylesheet is loaded only by /docs. Keep all mobile nav actions visible. */
  .site-nav .nav-inner { padding-right: 16px; padding-left: 16px; gap: 12px; }
  .site-nav .nav-actions { gap: 6px; }
  .site-nav .nav-actions .btn { padding-right: 10px; padding-left: 10px; font-size: 11px; }
  .docs-page.page-wrap { padding-right: 16px; padding-left: 16px; }
  .docs-meta { gap: 8px 12px; }
  .docs-card { padding: 18px; }
  .docs-note { padding: 12px 14px; }
  .docs-content .code-block pre { padding-right: 14px; padding-left: 14px; font-size: 11px; }
  .docs-details > summary { padding: 14px; }
  .docs-details-body { padding-right: 12px; padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .docs-page *, .docs-page *::before, .docs-page *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
