/* ============================================================
   Moony Labs - documentation layout (CLI reference)
   Builds on assets/styles.css tokens & components.
   ============================================================ */

.docs-shell {
  max-width: 1240px; margin: 0 auto; padding-inline: var(--pad);
  display: grid; grid-template-columns: 248px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px); align-items: start;
  padding-top: clamp(40px, 6vw, 64px); padding-bottom: 40px;
}
@media (max-width: 960px) { .docs-shell { grid-template-columns: 1fr; gap: 0; } }

/* ---------- table of contents ---------- */
.toc { position: sticky; top: 88px; align-self: start; }
@media (max-width: 960px) { .toc { display: none; } }
.toc-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mute); padding: 0 0 14px 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); counter-reset: toc; }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 7px 0 7px 18px; margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: 13.5px; line-height: 1.35; color: var(--mute);
  text-decoration: none; transition: color .15s ease, border-color .15s ease;
}
.toc a:hover { color: var(--dim); }
.toc a.active { color: var(--text); border-left-color: var(--acc-bright); }

/* ---------- doc header ---------- */
.doc-main { min-width: 0; max-width: 800px; }
.doc-head { padding-bottom: clamp(28px, 4vw, 40px); border-bottom: 1px solid var(--line); margin-bottom: clamp(28px, 4vw, 40px); }
.doc-eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--acc-bright); }
.doc-head h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.03em; margin-top: 16px; line-height: 1.04; }
.doc-head .lead { font-size: clamp(16.5px, 1.5vw, 19px); color: var(--dim); margin-top: 20px; line-height: 1.6; max-width: 60ch; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.doc-meta .chip { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; background: var(--bg-1); }
.doc-meta .chip svg { width: 13px; height: 13px; color: var(--acc-bright); }

/* ---------- sections ---------- */
.doc-section { padding-top: clamp(40px, 5vw, 56px); scroll-margin-top: 84px; }
.doc-section:first-of-type { padding-top: 8px; }
.doc-section > h2 { font-size: clamp(23px, 2.6vw, 30px); letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 12px; }
.doc-section > h2 .sn { font-family: var(--mono); font-size: 14px; font-weight: 400; color: var(--acc-bright); letter-spacing: 0; }
.doc-section h3 { font-size: 17px; margin-top: 30px; color: var(--text); }

/* ---------- prose ---------- */
.doc-section p { color: var(--dim); font-size: 15.5px; line-height: 1.68; margin-top: 16px; max-width: 68ch; }
.doc-section ul { margin: 16px 0 0; padding: 0; list-style: none; max-width: 68ch; }
.doc-section ul li { position: relative; padding-left: 22px; color: var(--dim); font-size: 15.5px; line-height: 1.62; margin-top: 10px; }
.doc-section ul li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--acc-bright); opacity: 0.7; }
.doc-section ul li b, .doc-section p b { color: var(--text); font-weight: 600; }
.doc-section a:not(.btn) { color: var(--acc-bright); text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--acc-bright) 30%, transparent); transition: border-color .15s ease; }
.doc-section a:not(.btn):hover { border-bottom-color: var(--acc-bright); }
.doc-section :is(p, li) code, code.ic {
  font-family: var(--mono); font-size: 0.86em; color: var(--lav);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px;
  padding: 1.5px 6px; word-break: break-word;
}
.doc-section .block-space { height: 22px; }

/* ---------- callouts ---------- */
.callout { display: flex; gap: 13px; margin-top: 22px; padding: 16px 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--bg-1); }
.callout .ci { flex: none; width: 19px; height: 19px; margin-top: 1px; }
.callout .ctitle { font-weight: 600; color: var(--text); font-size: 14.5px; font-family: var(--display); letter-spacing: -0.005em; }
.callout .cbody { font-size: 14.5px; color: var(--dim); line-height: 1.58; margin-top: 4px; }
.callout .cbody code { font-size: 0.86em; }
.callout.note { border-left: 2px solid var(--acc-bright); }
.callout.note .ci { color: var(--acc-bright); }
.callout.warn { border-left: 2px solid var(--warn); background: color-mix(in oklab, var(--warn) 6%, var(--bg-1)); }
.callout.warn .ci { color: var(--warn); }
.callout.danger { border-left: 2px solid #f0625a; background: color-mix(in oklab, #f0625a 7%, var(--bg-1)); }
.callout.danger .ci { color: #f0625a; }

/* spacing helper after code blocks */
.doc-section .term, .doc-section .addr-row, .doc-section .doc-table { margin-top: 20px; }
.term-fname { margin-left: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--mute); }

/* ---------- reference table ---------- */
.doc-table { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.dt-row { display: grid; grid-template-columns: 200px 1fr auto; align-items: center; gap: 14px; padding: 13px 16px; border-top: 1px solid var(--line); }
.dt-row:first-child { border-top: 0; background: var(--bg-1); }
.dt-row .dh { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.dt-row .dl { font-family: var(--body); font-size: 14px; color: var(--text); font-weight: 500; }
.dt-row code { font-family: var(--mono); font-size: 12px; color: var(--lav); word-break: break-all; }
.dt-row .dx { display: inline-flex; gap: 8px; align-items: center; }
.dt-row .dx a { color: var(--mute); border: 0 !important; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--bg-2); transition: color .15s ease, background .15s ease; }
.dt-row .dx a:hover { color: var(--acc-bright); background: var(--bg-3); }
.dt-row .dx a svg { width: 14px; height: 14px; }
@media (max-width: 640px) { .dt-row { grid-template-columns: 1fr; gap: 7px; } .dt-row .dx { justify-self: start; } }

/* ---------- "what it does" inline meta strip on commands ---------- */
.cmd-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cmd-meta .m { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); border: 1px solid var(--line); border-radius: 7px; padding: 6px 11px; background: var(--bg-1); }
.cmd-meta .m .d { width: 6px; height: 6px; border-radius: 50%; }
.cmd-meta .m.safe .d { background: var(--pos); }
.cmd-meta .m.funds .d { background: var(--warn); }
.cmd-meta .m.final .d { background: #f0625a; }

/* ---------- see also ---------- */
.seealso { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
@media (max-width: 600px) { .seealso { grid-template-columns: 1fr; } }
.seealso a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-1); text-decoration: none; border-bottom: 1px solid var(--line) !important; transition: border-color .18s ease, transform .18s ease; }
.seealso a:hover { border-color: var(--line-2) !important; transform: translateY(-2px); }
.seealso a > span:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.seealso .sl-t { font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--text); }
.seealso .sl-d { font-family: var(--mono); font-size: 11.5px; color: var(--mute); margin-top: 0; }
.seealso .sl-x { color: var(--mute); flex: none; }
.seealso .sl-x svg { width: 17px; height: 17px; }

/* breadcrumb */
.crumb { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--mute); margin-bottom: 20px; }
.crumb a { color: var(--mute); text-decoration: none; }
.crumb a:hover { color: var(--dim); }
.crumb .sep { opacity: 0.5; }

/* mobile section nav (select) */
.toc-mobile { display: none; }
@media (max-width: 960px) {
  .toc-mobile { display: block; position: sticky; top: 66px; z-index: 20; margin: 0 calc(var(--pad) * -1) 8px; padding: 12px var(--pad); background: rgba(13,13,17,0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .toc-mobile select { width: 100%; font-family: var(--mono); font-size: 13px; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 11px 14px; }
}


/* ---------- numbered step list (CLI roadmap) ---------- */
.dx-steps { list-style: none; counter-reset: dxs; margin: 18px 0 0; padding: 0; }
.dx-steps li { counter-increment: dxs; position: relative; padding: 9px 0 9px 40px; font-size: 16px; line-height: 1.6; color: var(--dim); border-bottom: 1px solid var(--line); }
.dx-steps li:last-child { border-bottom: 0; }
.dx-steps li::before { content: counter(dxs); position: absolute; left: 0; top: 9px; width: 26px; height: 26px; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--acc-bright); border: 1px solid var(--line-2); border-radius: 50%; background: var(--bg-1); }
