/* Manual pages — two-column layout (sticky TOC + body) on top of site.css tokens. */

.manual-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

@media (min-width: 1000px) {
  .manual-shell {
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 56px;
    padding: 0 32px;
  }
}

/* ── Table of contents ───────────────────────────────────────────── */

.manual-toc {
  display: none;
}

@media (min-width: 1000px) {
  .manual-toc {
    display: block;
    position: sticky;
    top: 78px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 40px 0 40px;
    font-size: 13px;
    line-height: 1.5;
  }
}

.manual-toc .toc-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.manual-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}

.manual-toc li {
  margin: 0 0 2px;
}

.manual-toc a {
  display: block;
  padding: 5px 10px 5px 12px;
  border-left: 2px solid transparent;
  color: var(--text-mute);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  border-radius: 0 3px 3px 0;
}

.manual-toc a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
}

.manual-toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(100, 181, 246, 0.06);
}

/* ── Body ────────────────────────────────────────────────────────── */

.manual-body {
  min-width: 0;
  padding: 40px 0 88px;
  color: var(--text-mute);
  font-size: 15px;
  line-height: 1.75;
}

.manual-head {
  padding-bottom: 28px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.manual-head .breadcrumb {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.manual-head .breadcrumb a { color: var(--text-mute); }
.manual-head .breadcrumb a:hover { color: var(--text); }

.manual-head h1 {
  font-family: var(--font-brand);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #fff;
  margin-bottom: 12px;
}

.manual-head .lede {
  font-size: 16px;
  color: var(--text-mute);
  line-height: 1.65;
  max-width: 680px;
  margin-bottom: 18px;
}

.manual-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.manual-meta .chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--text-mute);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--bg-card);
}

.manual-meta .chip strong { color: var(--text); font-weight: 600; }

.manual-body section {
  scroll-margin-top: 84px;
  padding-top: 40px;
}

.manual-body h2 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #fff;
  margin-bottom: 6px;
}

.manual-body h2 .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-faint);
  margin-right: 12px;
}

.manual-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 30px 0 8px;
  letter-spacing: -0.1px;
}

.manual-body h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 22px 0 6px;
}

.manual-body p { margin-bottom: 14px; max-width: 780px; }
.manual-body ul, .manual-body ol { margin: 0 0 16px 22px; max-width: 780px; }
.manual-body li { margin-bottom: 7px; }
.manual-body strong { color: var(--text); font-weight: 600; }
.manual-body a { color: var(--accent); }
.manual-body a:hover { text-decoration: underline; }

.manual-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--text);
}

.manual-body pre {
  background: #08080c;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 18px 22px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #c9d1d9;
  margin: 0 0 18px;
}

.manual-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.manual-body .sub {
  font-size: 15px;
  color: var(--text-mute);
  margin-bottom: 22px;
  max-width: 780px;
}

/* ── Figures ─────────────────────────────────────────────────────── */

.shot {
  margin: 24px 0 30px;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #000;
}

.shot.narrow {
  max-width: 300px;
}

.shot figcaption {
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.6;
  margin-top: 10px;
  padding-left: 2px;
}

.shot figcaption strong { color: var(--text-mute); font-weight: 600; }

.shot-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin: 24px 0 30px;
}

@media (min-width: 760px) {
  .shot-row { grid-template-columns: 1fr 1fr; }
}

.shot-row .shot { margin: 0; }

/* ── Tables ──────────────────────────────────────────────────────── */

.manual-table-wrap {
  overflow-x: auto;
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.manual-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.6;
}

.manual-table th,
.manual-table td {
  padding: 11px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.manual-table thead th {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--bg-card);
  white-space: nowrap;
}

.manual-table tbody tr:last-child td { border-bottom: 0; }
.manual-table tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }

.manual-table td strong,
.manual-table td .ctl {
  color: var(--text);
  font-weight: 600;
}

.manual-table .mono,
.manual-table td code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  white-space: nowrap;
}

/* ── Callouts ────────────────────────────────────────────────────── */

.note {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: rgba(100, 181, 246, 0.05);
  border-radius: 0 5px 5px 0;
  padding: 14px 20px;
  margin: 0 0 22px;
  font-size: 14px;
  max-width: 780px;
}

.note.warn {
  border-left-color: #f0b429;
  background: rgba(240, 180, 41, 0.06);
}

.note.danger {
  border-left-color: var(--danger);
  background: rgba(248, 113, 113, 0.06);
}

.note p:last-child { margin-bottom: 0; }

.note .note-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.note.warn .note-label { color: #f0b429; }
.note.danger .note-label { color: var(--danger); }

/* ── Step list ───────────────────────────────────────────────────── */

.steps {
  counter-reset: step;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  max-width: 780px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 16px 44px;
  margin: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Section divider + footer nav ────────────────────────────────── */

.manual-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 44px 0 0;
}

.manual-next {
  margin-top: 56px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-card);
}

.manual-next h3 { margin: 0 0 6px; font-size: 15px; }
.manual-next p { margin: 0; font-size: 14px; }

@media (max-width: 999px) {
  .manual-head h1 { font-size: 34px; }
  .manual-body { font-size: 14.5px; padding-top: 28px; }
  .manual-body h2 { font-size: 22px; }
}
