/* ============================================================
   ILX Studio — User Manual Section
   ============================================================ */

.manual-section {
  padding: 5rem 0 4rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.m-ch[id] {
  scroll-margin-top: 90px;
}

.manual-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.manual-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.manual-meta {
  font-size: 0.81rem;
  color: var(--muted);
}

/* ── Layout ──────────────────────────────────────────────── */
.manual-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .manual-layout { grid-template-columns: 1fr; }
  .manual-toc { display: none; }
}

/* ── Sticky TOC ──────────────────────────────────────────── */
.manual-toc {
  position: sticky;
  top: 76px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem 1rem;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.manual-toc::-webkit-scrollbar { width: 4px; }
.manual-toc::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.toc-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.6rem;
  padding: 0 0.4rem;
}

.manual-toc a {
  display: block;
  font-size: 0.775rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.27rem 0.55rem;
  border-radius: 6px;
  line-height: 1.35;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manual-toc a:hover,
.manual-toc a.toc-active {
  background: rgba(26,112,255,0.1);
  color: var(--blue);
}

.toc-sep {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0.4rem;
}

/* ── Chapter Accordion ───────────────────────────────────── */
.m-ch {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.7rem;
  background: var(--bg2);
  transition: box-shadow 0.15s;
}

.m-ch[open] {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

html[data-theme="dark"] .m-ch[open] {
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.m-ch > summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--heading);
  list-style: none;
  user-select: none;
  border-radius: 12px;
  transition: background 0.12s, color 0.12s;
}

.m-ch > summary::-webkit-details-marker { display: none; }

.m-ch > summary:hover { background: rgba(26,112,255,0.04); }

.m-ch[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  background: rgba(26,112,255,0.05);
  color: var(--blue);
}

html[data-theme="dark"] .m-ch[open] > summary {
  background: rgba(26,112,255,0.08);
}

.ch-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(26,112,255,0.1);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  padding: 0 6px;
  letter-spacing: -0.02em;
}

.m-ch[open] > summary .ch-n {
  background: var(--blue);
  color: #fff;
}

.ch-arr {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.m-ch[open] > summary .ch-arr {
  transform: rotate(180deg);
  color: var(--blue);
}

/* ── Chapter Body ────────────────────────────────────────── */
.ch-b {
  padding: 1.5rem 1.5rem 1.75rem;
}

.ch-b h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--heading);
  margin: 1.4rem 0 0.45rem;
}

.ch-b h3:first-child { margin-top: 0; }

.ch-b p {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0.4rem 0;
}

.ch-b ul,
.ch-b ol {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text);
  padding-left: 1.45rem;
}

.ch-b li { margin: 0.2rem 0; }

.ch-b code {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.8rem;
  background: rgba(26,112,255,0.08);
  color: var(--blue);
  padding: 0.1em 0.42em;
  border-radius: 4px;
}

html[data-theme="dark"] .ch-b code { background: rgba(26,112,255,0.16); }

.ch-b kbd {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.78rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  color: var(--text);
  padding: 0.1em 0.48em;
  border-radius: 5px;
  white-space: nowrap;
}

.ch-b blockquote {
  border-left: 3px solid var(--blue);
  margin: 1rem 0;
  padding: 0.7rem 1rem;
  background: rgba(26,112,255,0.04);
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
}

html[data-theme="dark"] .ch-b blockquote { background: rgba(26,112,255,0.08); }

.ch-b strong { color: var(--heading); }

.ch-b a { color: var(--blue); }

/* ── Tables ──────────────────────────────────────────────── */
.m-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.815rem;
  margin: 0.75rem 0 1.1rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.m-tbl th {
  background: rgba(26,112,255,0.07);
  color: var(--heading);
  font-weight: 600;
  text-align: left;
  padding: 0.58rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.77rem;
  letter-spacing: 0.02em;
}

html[data-theme="dark"] .m-tbl th { background: rgba(26,112,255,0.13); }

.m-tbl td {
  padding: 0.5rem 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.m-tbl tr:last-child td { border-bottom: none; }

.m-tbl tr:hover td { background: rgba(26,112,255,0.02); }

/* ── Images ──────────────────────────────────────────────── */
.m-img {
  margin: 1.5rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.m-img img {
  width: 100%;
  height: auto;
  display: block;
}

.m-img figcaption {
  padding: 0.6rem 1rem;
  font-size: 0.76rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg2);
  line-height: 1.5;
}

/* ── Placeholder ─────────────────────────────────────────── */
.m-ph {
  margin: 1.5rem 0;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--bg);
}

.m-ph-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 0.5rem;
  opacity: 0.25;
  display: block;
}

.m-ph-cap {
  font-size: 0.81rem;
  color: var(--muted);
  line-height: 1.55;
}

.m-ph-file {
  font-size: 0.71rem;
  color: var(--blue);
  opacity: 0.55;
  font-family: ui-monospace, monospace;
  margin-top: 0.25rem;
  display: block;
}

/* ── Status ──────────────────────────────────────────────── */
.m-pass { color: var(--green); font-weight: 600; }
.m-fail { color: #ef4444; font-weight: 600; }
.m-warn { color: #f59e0b; font-weight: 600; }

/* ── Small outline button ────────────────────────────────── */
.btn-outline-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  background: transparent;
  text-decoration: none;
  transition: background 0.13s, border-color 0.13s;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.btn-outline-sm:hover {
  background: rgba(26,112,255,0.07);
  border-color: var(--blue);
  color: var(--blue);
}
