/* Docs — layered on /style.css, same tokens. */

.docs {
  max-width: var(--maxw); margin: 0 auto; padding: 48px var(--gutter) 96px;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px;
}

/* sidebar */
.toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 14.5px; }
.toc summary { display: none; }
.toc h2 { font-size: 13px; font-weight: 650; color: var(--ink); margin: 22px 0 6px; }
.toc h2:first-of-type { margin-top: 0; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 4px 0 4px 12px; border-left: 1px solid var(--line); color: var(--ink-2); }
.toc li a:hover { color: var(--ink); border-left-color: var(--ink-2); text-decoration: none; }
.toc li li a { padding-left: 24px; font-size: 13.5px; }

/* body */
.doc { min-width: 0; max-width: 780px; }
.doc > header h1 { font-size: clamp(32px, 4.4vw, 44px); font-weight: 700; letter-spacing: -0.03em; }
.doc > header p { margin-top: 14px; font-size: 18px; color: var(--ink-2); max-width: 38em; }

.doc section { scroll-margin-top: 84px; }
.doc .part { margin-top: 72px; padding-top: 28px; border-top: 2px solid var(--ink); }
.doc .part > h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.doc .part > p:first-of-type, .doc .part > h2 + p { margin-top: 10px; }
.doc h3 { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; margin-top: 48px; scroll-margin-top: 84px; }
.doc h4 { font-size: 14px; font-weight: 650; margin-top: 22px; }
.doc p, .doc li { color: var(--ink-2); }
.doc p { margin-top: 12px; }
.doc b, .doc strong { color: var(--ink); font-weight: 650; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 12px 0 0; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--muted); }

.doc :not(pre) > code {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 1px 5px; color: var(--ink); font-size: 0.86em; overflow-wrap: anywhere;
}
.doc pre.code { margin: 12px 0 0; }

.doc ol.how { counter-reset: how; list-style: none; padding: 0; }
.doc ol.how > li { counter-increment: how; position: relative; padding-left: 40px; margin: 22px 0 0; }
.doc ol.how > li::before {
  content: counter(how);
  position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font: 700 13px/1 var(--font-sans);
}
.doc ol.how > li > b:first-child { display: block; }

.callout {
  margin-top: 16px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  font-size: 15px;
}
.callout p { margin: 0; }

/* tables */
.tbl { width: 100%; margin-top: 14px; overflow-x: auto; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc th { text-align: left; font-weight: 650; color: var(--ink); font-size: 13px; }
.doc th, .doc td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.doc td:first-child { white-space: nowrap; }
.doc td:first-child code { color: var(--ink); }

/* evaluator voice, as in the app */
.voice { font-family: var(--font-serif); color: var(--ink); }

/* API endpoints */
.endpoint { margin-top: 48px; padding-top: 4px; }
.endpoint > h3 { margin-top: 0; }
.route {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 10px !important; padding: 7px 14px 7px 7px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 14.5px; font-weight: 500; color: var(--ink);
}
.method {
  font: 700 11.5px/1 var(--font-mono); padding: 5px 7px; border-radius: var(--radius-sm);
  background: var(--sev-none-bg); color: var(--sev-none);
}
.method.post { background: var(--accent-soft); color: var(--accent); }
.status-list { list-style: none; padding: 0 !important; }
.status-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; }
.status-list code { justify-self: start; }

@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; gap: 0; padding-top: 24px; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 32px; }
  .toc summary { display: block; padding: 12px 16px; font-weight: 650; cursor: pointer; }
  .toc nav { padding: 0 16px 16px; }
  .toc:not([open]) nav { display: none; }
}
@media (min-width: 901px) {
  .toc nav { display: block !important; }
}

.doc .ret { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
