/* neurova-ai.com/shop/<app>/docs/: app documentation (_layouts/docs.html).
 *
 * Loaded by _includes/head.html on pages with `layout: docs`, after site.css.
 * Three columns on wide screens (sidebar, page, "On this page"), two below
 * 1180px, one on phones, where the sidebar folds into a Menu button. Same
 * house rules as the rest of the site: paper and ink, no accent colour, links
 * underlined, dashed rules between sections.
 */

.docs {
  display: grid; grid-template-columns: 248px minmax(0, 1fr) 200px; gap: 3.5rem;
  max-width: 1320px; margin: 0 auto; padding: 7.5rem 2rem 5rem; align-items: start;
}
.docs-visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------------- sidebar */
/* Only the page list scrolls, so the search results can spread over the page. */
.docs-side { position: sticky; top: 96px; z-index: 5; }
.docs-nav { max-height: calc(100vh - 290px); overflow-y: auto; padding: 0 0.4rem 1.5rem 0.7rem; margin-left: -0.7rem; scrollbar-width: thin; }
.docs-brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; margin: 0 0 1.3rem; }
.docs-brand-icon { width: 40px; flex: none; }
.docs-brand-icon .app-icon-img { display: block; width: 100%; height: auto; }
.docs-brand-icon .app-icon { width: 100%; aspect-ratio: 1; border-radius: 22.5%; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; }
.docs-brand-icon .app-icon svg { width: 62%; height: auto; }
.docs-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.docs-brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1rem; color: var(--ink); letter-spacing: -0.01em; }
.docs-brand-sub { font-family: 'Space Mono', monospace; font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.docs-search { position: relative; margin: 0 0 1.6rem; }
.docs-search-input {
  width: 100%; font: inherit; font-size: 0.9rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--border-ui); border-radius: 8px;
  padding: 0.55rem 2.2rem 0.55rem 0.75rem; -webkit-appearance: none; appearance: none;
}
.docs-search-input::placeholder { color: var(--muted); }
.docs-search-input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.docs-search-input::-webkit-search-cancel-button { display: none; }
.docs-search-key {
  position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%);
  font-family: 'Space Mono', monospace; font-size: 0.7rem; color: var(--muted);
  border: 1px solid var(--rule-strong); border-radius: 4px; padding: 0 0.35rem; line-height: 1.5; pointer-events: none;
}
.docs-search-input:focus + .docs-search-key { display: none; }
.docs-results {
  position: absolute; z-index: 20; left: 0; top: calc(100% + 6px); width: min(420px, calc(100vw - 2rem));
  background: var(--card); border: 1px solid var(--rule-strong); border-radius: 10px;
  box-shadow: 0 18px 40px -18px rgba(20, 18, 15, 0.35); padding: 0.35rem; max-height: 60vh; overflow-y: auto;
}
.docs-results a { display: block; padding: 0.6rem 0.7rem; border-radius: 7px; text-decoration: none; color: var(--ink-2); }
.docs-results a[aria-selected="true"], .docs-results a:hover { background: var(--paper-2); }
.docs-result-title { display: block; font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.docs-result-text { display: block; font-size: 0.8rem; line-height: 1.5; color: var(--muted); margin-top: 0.15rem; }
.docs-results mark { background: none; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--rule-strong); }
.docs-results-empty { padding: 0.7rem; font-size: 0.85rem; color: var(--muted); margin: 0; }

.docs-nav-toggle { display: none; }
.docs-nav-heading {
  font-family: 'Space Mono', monospace; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin: 1.4rem 0 0.45rem;
}
.docs-nav-heading:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li { margin: 0; }
.docs-nav a {
  display: block; padding: 0.32rem 0.7rem; margin-left: -0.7rem; border-radius: 6px;
  font-size: 0.92rem; line-height: 1.4; color: var(--ink-2); text-decoration: none;
}
.docs-nav a:hover { background: var(--paper-2); color: var(--ink); }
.docs-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); font-weight: 500; }

/* ---------------------------------------------------------------- page */
.docs-main { min-width: 0; max-width: 720px; }
.docs-kicker {
  font-family: 'Space Mono', monospace; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 0.8rem;
}
.docs-main h1 {
  font-family: 'Space Grotesk', sans-serif; font-size: clamp(2rem, 3.6vw, 2.75rem); font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.1; color: var(--ink); margin: 0 0 1rem;
}
.docs-lede { font-size: 1.12rem; line-height: 1.65; color: var(--muted); margin: 0 0 2rem; max-width: 60ch; }

.docs-body { color: var(--ink-2); }
.docs-body > :first-child { margin-top: 0; }
.docs-body p, .docs-body ul, .docs-body ol { font-size: 1rem; line-height: 1.75; margin: 0 0 1.25rem; }
.docs-body ul, .docs-body ol { padding-left: 1.3rem; }
.docs-body li { margin: 0 0 0.45rem; }
.docs-body li > ul, .docs-body li > ol { margin: 0.45rem 0 0; }
.docs-body h2 {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.022em;
  line-height: 1.25; color: var(--ink); margin: 3rem 0 0.9rem; padding-top: 1.6rem;
  border-top: 1px dashed var(--rule); scroll-margin-top: 92px;
}
.docs-body > h2:first-child { border-top: 0; padding-top: 0; }
.docs-body h3 {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.12rem; font-weight: 600; color: var(--ink);
  margin: 2rem 0 0.6rem; scroll-margin-top: 92px;
}
.docs-body strong { color: var(--ink); font-weight: 600; }
.docs-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.docs-body a:hover { text-decoration-color: var(--ink); }
.docs-body code { font-family: 'Space Mono', monospace; font-size: 0.84em; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 4px; padding: 0.05em 0.3em; overflow-wrap: anywhere; }
.docs-body pre {
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; padding: 0.9rem 1rem;
  overflow-x: auto; margin: 0 0 1.4rem; font-size: 0.8rem; line-height: 1.6;
}
.docs-body pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; color: var(--ink); }
.docs-body kbd, .docs-key {
  /* The system font draws the Mac key symbols (⌃ ⌥ ⌘ ⇧ ↩ ⌫) best. */
  display: inline-block; font-family: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif; font-size: 0.92em; font-weight: 500; line-height: 1.35; letter-spacing: 0.08em;
  color: var(--ink); background: var(--card); border: 1px solid var(--rule-strong); border-bottom-width: 2px;
  border-radius: 5px; padding: 0.05em 0.42em; white-space: nowrap;
}

/* Tables: up to three columns of prose. On phones the cells stack, so a long
 * key or link never widens the page (body clips overflow-x). */
.docs-body table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 0 0 1.6rem; }
.docs-body th, .docs-body td { text-align: left; vertical-align: top; padding: 0.55rem 0.8rem 0.55rem 0; border-top: 1px solid var(--rule); line-height: 1.55; }
.docs-body thead th { font-family: 'Space Mono', monospace; font-size: 0.68rem; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-top: 0; }
.docs-body tbody th { font-weight: 600; color: var(--ink); }
.docs-body td:last-child, .docs-body th:last-child { padding-right: 0; }

/* Notes: "Tip", "Note", "Important". Kramdown: a blockquote with {: .docs-note} etc. */
.docs-body .docs-note, .docs-body .docs-tip, .docs-body .docs-warn {
  border: 1px solid var(--rule); border-left: 3px solid var(--ink); border-radius: 0 8px 8px 0;
  background: var(--paper-2); padding: 0.85rem 1.1rem; margin: 0 0 1.5rem;
}
.docs-body .docs-tip { border-left-style: dashed; }
.docs-body .docs-warn { background: var(--card); border-left-width: 5px; }
.docs-body .docs-note > :last-child, .docs-body .docs-tip > :last-child, .docs-body .docs-warn > :last-child { margin-bottom: 0; }
.docs-body .docs-note p, .docs-body .docs-tip p, .docs-body .docs-warn p { font-size: 0.95rem; line-height: 1.65; }

/* Numbered steps with a rule down the left. */
.docs-body ol.docs-steps { list-style: none; counter-reset: step; padding-left: 0; }
.docs-body ol.docs-steps > li { counter-increment: step; position: relative; padding: 0 0 0.6rem 2.6rem; margin: 0; }
.docs-body ol.docs-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.1rem; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-family: 'Space Mono', monospace; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
}
.docs-body ol.docs-steps > li::after { content: ""; position: absolute; left: 0.83rem; top: 2rem; bottom: 0.2rem; border-left: 1px dashed var(--rule-strong); }
.docs-body ol.docs-steps > li:last-child::after { display: none; }

/* Section cards on a Getting started page. */
.docs-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin: 0 0 2rem; }
.docs-body a.docs-card {
  display: flex; flex-direction: column; gap: 0.35rem; text-decoration: none; color: var(--ink-2);
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 1.05rem 1.15rem 1.1rem;
  transition: border-color 0.18s, transform 0.18s;
}
.docs-body a.docs-card:hover { border-color: var(--ink); transform: translateY(-1px); }
.docs-card-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.docs-card-text { font-size: 0.88rem; line-height: 1.55; color: var(--muted); }
.docs-card-more { margin-top: auto; padding-top: 0.35rem; font-family: 'Space Mono', monospace; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }

/* Buttons inside docs (Download, Buy, App Store). */
.docs-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 2rem; }
.docs-body .docs-actions a.btn-hero { padding: 0.62rem 1.4rem; font-size: 0.88rem; color: var(--paper); text-decoration: none; }
.docs-body .docs-actions a.btn-hero-alt { color: var(--ink); }

.docs-updated { font-family: 'Space Mono', monospace; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 3rem 0 0; }
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin: 1.4rem 0 0; padding-top: 1.4rem; border-top: 1px dashed var(--rule); }
.docs-pager-link {
  display: flex; flex-direction: column; gap: 0.2rem; text-decoration: none; border: 1px solid var(--rule);
  border-radius: 10px; padding: 0.85rem 1rem; transition: border-color 0.18s;
}
.docs-pager-link:hover { border-color: var(--ink); }
.docs-pager-next { text-align: right; grid-column: 2; }
.docs-pager-dir { font-family: 'Space Mono', monospace; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.docs-pager-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; color: var(--ink); }
.docs-help { font-size: 0.9rem; color: var(--muted); margin: 1.6rem 0 0; line-height: 1.6; }
.docs-help a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }

/* ------------------------------------------------------- on this page */
.docs-toc { position: sticky; top: 96px; max-height: calc(100vh - 112px); overflow-y: auto; font-size: 0.85rem; }
.docs-toc-heading { font-family: 'Space Mono', monospace; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0.4rem 0 0.6rem; }
.docs-toc ul, .docs-toc-inline ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.docs-toc li, .docs-toc-inline li { margin: 0; }
.docs-toc a, .docs-toc-inline a {
  display: block; padding: 0.28rem 0 0.28rem 0.8rem; margin-left: -1px; border-left: 2px solid transparent;
  color: var(--muted); text-decoration: none; line-height: 1.4;
}
.docs-toc a:hover, .docs-toc-inline a:hover { color: var(--ink); }
.docs-toc a.is-active { color: var(--ink); border-left-color: var(--ink); font-weight: 500; }
.docs-toc-inline { display: none; margin: 0 0 2rem; border: 1px solid var(--rule); border-radius: 10px; padding: 0.7rem 1rem; background: var(--card); }
.docs-toc-inline summary { cursor: pointer; font-family: 'Space Mono', monospace; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); }
.docs-toc-inline ul { margin-top: 0.7rem; font-size: 0.9rem; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .docs { grid-template-columns: 228px minmax(0, 1fr); gap: 3rem; }
  .docs-toc { display: none; }
  .docs-toc-inline { display: block; }
}
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; padding: 6.2rem 1rem 4rem; }
  .docs-side { position: static; }
  .docs-nav { max-height: none; overflow: visible; }
  .docs-brand { margin-bottom: 1rem; }
  .docs-search { margin-bottom: 0.8rem; }
  .docs-search-key { display: none; }
  .docs-nav-toggle {
    display: flex; width: 100%; align-items: center; gap: 0.7rem; font: inherit; font-size: 0.92rem; cursor: pointer;
    background: var(--card); color: var(--ink); border: 1px solid var(--border-ui); border-radius: 8px; padding: 0.6rem 0.8rem; text-align: left;
  }
  .docs-nav-toggle::after { content: ""; margin-left: auto; width: 0.5rem; height: 0.5rem; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
  .docs-nav-toggle[aria-expanded="true"]::after { transform: rotate(-135deg) translateY(-2px); }
  .docs-nav-toggle-label { font-family: 'Space Mono', monospace; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
  .docs-nav-toggle-current { font-weight: 500; }
  /* Folded only once docs.js runs, so the menu still shows without JavaScript. */
  .docs.js-ready .docs-nav { display: none; }
  .docs.js-ready .docs-nav.is-open { display: block; padding: 0.9rem 0 0.4rem 0.8rem; }
  .docs-results { width: 100%; }
  .docs-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .docs-body table, .docs-body tbody, .docs-body tr { display: block; width: 100%; }
  .docs-body table.docs-keys { table-layout: auto; }
  .docs-body tbody tr { border-top: 1px solid var(--rule); padding: 0.5rem 0; }
  .docs-body th, .docs-body td { display: block; width: auto !important; padding: 0.1rem 0; border-top: 0; }
  .docs-body thead { display: none; }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager-next { grid-column: 1; }
}

/* A small dated line under a heading (release notes): {: .docs-meta} */
.docs-body p.docs-meta { font-family: 'Space Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: -0.5rem 0 1rem; }

/* Key/value tables (no header row): {: .docs-kv} */
.docs-body table.docs-kv td:first-child { font-weight: 600; color: var(--ink); width: 6.5rem; }


/* Shortcut tables: the same column widths in every section, so they line up. {: .docs-keys} */
.docs-body table.docs-keys { table-layout: fixed; }
.docs-body table.docs-keys th:nth-child(1) { width: 36%; }
.docs-body table.docs-keys th:nth-child(2) { width: 22%; }
