/* NextSay Docs — a standard docs layout: persistent left nav, a content column,
   and an on-page table of contents. Shared by every /docs page. Uses the site
   tokens (--text, --muted) from site-header.css / article-styles.css. */

.docs-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  align-items: start;
}
.docs-shell.with-toc { grid-template-columns: 248px minmax(0, 1fr) 208px; }

/* ---- Left nav ---- */
.docs-nav {
  position: sticky;
  top: 0;
  align-self: stretch;
  padding: 30px 24px 40px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 14px;
}
.docs-nav > summary { display: none; } /* desktop: no toggle; mobile re-shows it */
.docs-nav-group { margin-bottom: 22px; }
.docs-nav-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px 8px;
}
.docs-nav a, .docs-nav .soon {
  display: block; padding: 6px 10px; border-radius: 7px;
  color: var(--muted); text-decoration: none; line-height: 1.3;
}
.docs-nav a:hover { color: var(--text); background: rgba(15, 23, 42, 0.04); }
.docs-nav a[aria-current="page"] {
  color: #4b5df6; font-weight: 600; background: rgba(75, 93, 246, 0.09);
}
.docs-nav a:focus-visible { outline: 2px solid #4b5df6; outline-offset: 1px; }
.docs-nav .soon { color: rgba(100, 116, 139, 0.7); display: flex; align-items: center; gap: 8px; }
.docs-nav .soon::after {
  content: "Soon"; font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid rgba(15, 23, 42, 0.14); border-radius: 999px; padding: 1px 6px;
}

/* ---- Content ---- */
.docs-content { padding: 34px 48px 72px; min-width: 0; }
.docs-crumb { font-size: 12.5px; color: var(--muted); display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin: 0 0 18px; }
.docs-crumb a { color: var(--muted); text-decoration: none; }
.docs-crumb a:hover { color: var(--text); }
.docs-crumb .sep { opacity: 0.45; }
.docs-crumb [aria-current] { color: var(--text); font-weight: 600; }

.docs-content .eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: #4b5df6; margin: 0 0 8px;
}
.docs-content h1 { font-size: 30px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
.docs-content > article > p:first-of-type, .docs-content .intro { font-size: 16px; color: var(--muted); line-height: 1.55; margin: 0 0 8px; max-width: 68ch; }
.docs-content h2 { font-size: 19px; margin: 40px 0 0; scroll-margin-top: 24px; letter-spacing: -0.005em; }
.docs-content section { margin-top: 8px; }
.docs-content p { line-height: 1.55; max-width: 70ch; }

/* Step list — compact, numbered. */
.steps { list-style: none; counter-reset: s; margin: 16px 0 0; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 0 30px; margin: 0 0 12px; line-height: 1.5; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(75, 93, 246, 0.10); color: #4b5df6;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
}
.steps b { font-weight: 600; }
.steps span { color: var(--muted); }

/* Definition rows — a term and one tight line. */
.defs { margin: 14px 0 0; }
.defs > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 4px 20px; padding: 12px 0; border-top: 1px solid rgba(15, 23, 42, 0.07); }
.defs > div:first-child { border-top: 0; padding-top: 0; }
.defs dt, .defs > div > :first-child { font-weight: 600; }
.defs dd, .defs > div > :last-child { margin: 0; color: var(--muted); }

/* Key/value config table. */
.kv { width: 100%; border-collapse: collapse; margin: 14px 0 0; font-size: 14.5px; }
.kv th, .kv td { text-align: left; padding: 9px 0; border-top: 1px solid rgba(15, 23, 42, 0.07); vertical-align: top; }
.kv tr:first-child th, .kv tr:first-child td { border-top: 0; }
.kv th { font-weight: 600; width: 190px; }
.kv td { color: var(--muted); }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: rgba(15, 23, 42, 0.06); padding: 1px 6px; border-radius: 5px; word-break: break-word; }

/* Copy-pastable command / file blocks. */
.docs-content pre { margin: 8px 0 2px; padding: 11px 13px; background: rgba(15, 23, 42, 0.045); border: 1px solid rgba(15, 23, 42, 0.10); border-radius: 9px; overflow-x: auto; font-size: 13px; line-height: 1.55; }
.docs-content pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; white-space: pre; word-break: normal; }

.note { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(15, 23, 42, 0.10); background: rgba(15, 23, 42, 0.02); font-size: 14px; }
.note.warn { border-color: rgba(217, 119, 6, 0.30); background: rgba(217, 119, 6, 0.06); }
.note b { font-weight: 600; }

/* FAQ */
.faq { margin: 14px 0 0; }
.faq details { border-top: 1px solid rgba(15, 23, 42, 0.07); }
.faq summary { cursor: pointer; list-style: none; position: relative; padding: 13px 28px 13px 0; font-weight: 600; font-size: 15px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 3px; top: 19px; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 160ms ease; }
.faq details[open] summary::after { transform: rotate(-135deg); top: 23px; }
.faq summary:focus-visible { outline: 2px solid #4b5df6; outline-offset: 2px; border-radius: 5px; }
.faq details > p { margin: 0 0 13px; color: var(--muted); font-size: 14px; }

/* Card grid for index pages. */
.docs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 20px 0 0; }
.docs-cards a, .docs-cards .card { display: block; border: 1px solid rgba(15, 23, 42, 0.10); border-radius: 12px; padding: 16px; text-decoration: none; color: inherit; }
.docs-cards a:hover { border-color: rgba(75, 93, 246, 0.42); }
.docs-cards h3 { margin: 10px 0 0; font-size: 15.5px; }
.docs-cards p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.docs-cards .badge { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; font-size: 18px; background: rgba(75, 93, 246, 0.10); color: #4b5df6; }
.docs-cards .card.disabled { opacity: 0.66; }
.docs-cards .soon-tag { display: inline-block; margin-top: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* On-page TOC (right). */
.docs-toc { position: sticky; top: 0; padding: 34px 20px; font-size: 13px; }
.docs-toc-title { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.docs-toc a { display: block; padding: 5px 0 5px 11px; color: var(--muted); text-decoration: none; border-left: 2px solid rgba(15, 23, 42, 0.10); line-height: 1.35; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a[aria-current="true"] { color: #4b5df6; font-weight: 600; border-left-color: #4b5df6; }

/* Mobile: nav becomes a disclosure above the content; TOC hides. */
.docs-nav-toggle { display: none; }
@media (max-width: 960px) {
  .docs-shell, .docs-shell.with-toc { grid-template-columns: minmax(0, 1fr); }
  .docs-toc { display: none; }
  .docs-nav {
    position: static; border-right: 0; border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0; max-width: 760px; margin: 0 auto; width: 100%;
  }
  .docs-nav[open] { padding-bottom: 16px; }
  .docs-nav > summary {
    display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
    padding: 14px 18px; font-weight: 600; color: var(--text);
  }
  .docs-nav > summary::-webkit-details-marker { display: none; }
  .docs-nav > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
  .docs-nav[open] > summary::after { transform: rotate(-135deg); }
  .docs-nav .docs-nav-group { padding: 0 12px; }
  .docs-content { padding: 24px 18px 56px; max-width: 760px; margin: 0 auto; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
