/* คู่มือการใช้งาน (pages/manual.php · WIP แถว 95) — หน้าเว็บ + โหมดพิมพ์ PDF */
.mn-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.mn-search { position: relative; flex: 0 1 420px; min-width: 240px; }
.mn-search > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.mn-search input { padding-left: 38px; }
.mn-hits { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; max-height: 380px; overflow: auto; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; }
.mn-hits a { display: block; padding: 8px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--text-main); }
.mn-hits a:hover { background: var(--bg-soft); }
.mn-hits b { display: block; font-size: .92rem; }
.mn-hits small, .mn-hit-none { color: var(--text-muted); font-size: .78rem; }
.mn-hit-none { padding: 10px; }

.mn-roles { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.mn-roles a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--border-color);
  background: var(--bg-card); color: var(--text-main); font-weight: 700; font-size: .9rem; text-decoration: none; }
.mn-roles a:hover { border-color: var(--sk); color: var(--text-main); }
.mn-roles a.on { background: linear-gradient(135deg, var(--sk-dk), var(--sk-deep)); border-color: transparent; color: #fff; }

.mn-body { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.mn-nav { position: sticky; top: 12px; max-height: calc(100vh - 110px); overflow: auto; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--r-lg); padding: 10px; }
.mn-nav a { display: block; padding: 6px 10px; border-radius: var(--r-sm); font-size: .86rem; line-height: 1.4; color: var(--text-main); text-decoration: none; }
.mn-nav a:hover { background: var(--bg-soft); }
.mn-nav a.on { background: color-mix(in srgb, var(--sk) 14%, transparent); color: var(--sk-ink); font-weight: 700; }
html.dark .mn-nav a.on { color: var(--text-main); }
.mn-nav-all { font-weight: 700; }
.mn-nav-all i { margin-right: 6px; }
.mn-nav-g { margin: 12px 10px 4px; font-size: .74rem; font-weight: 800; color: var(--text-muted); letter-spacing: .02em; }

.mn-main { min-width: 0; }
.mn-intro { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 8px;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg); }
.mn-gh { margin: 18px 0 10px; font-weight: 800; }
.mn-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.mn-card { display: flex; gap: 12px; padding: 13px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg); text-decoration: none; color: var(--text-main); }
.mn-card:hover { border-color: var(--sk); color: var(--text-main); box-shadow: var(--shadow); }
.mn-card .ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-md); font-size: 1.15rem;
  background: color-mix(in srgb, var(--sk) 13%, transparent); color: var(--sk-ink); }
html.dark .mn-card .ic { color: var(--text-main); }
.mn-card .tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mn-card b { font-size: .93rem; line-height: 1.35; }
.mn-card small { color: var(--text-muted); font-size: .79rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.mn-topic { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg); padding: 20px 24px; }
.mn-crumb { font-size: .8rem; color: var(--text-muted); margin-bottom: 8px; overflow-wrap: anywhere; }
.mn-crumb i { font-size: .65rem; margin: 0 3px; }
.mn-topic h3 { font-weight: 800; font-size: 1.35rem; margin-bottom: 8px; }
.mn-sum { color: var(--text-main); margin-bottom: 12px; line-height: 1.7; }
.mn-path { display: flex; gap: 9px; padding: 9px 13px; border-radius: var(--r-md); background: var(--bg-soft); font-size: .9rem; margin-bottom: 14px; overflow-wrap: anywhere; }
.mn-path i { color: var(--sk-ink); flex: none; }
html.dark .mn-path i { color: var(--text-main); }

.mn-steps { list-style: none; padding: 0; margin: 14px 0 12px; }
.mn-steps li { position: relative; padding: 2px 0 10px 40px; line-height: 1.7; counter-increment: mn; overflow-wrap: anywhere; }
.mn-steps li::before { content: counter(mn); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: #e11d48; color: #fff; font-weight: 800; font-size: .86rem; font-variant-numeric: tabular-nums; }
.mn-fig { margin: 4px 0 18px; }
.mn-fig a { display: block; }
.mn-fig img { display: block; max-width: 100%; height: auto; border: 1px solid var(--border-color); border-radius: var(--r-md); box-shadow: var(--shadow); }
.mn-note { display: flex; gap: 10px; padding: 10px 14px; margin: 10px 0; border-radius: var(--r-md); line-height: 1.65; font-size: .93rem; overflow-wrap: anywhere; }
.mn-note i { flex: none; font-size: 1.05rem; }
.mn-note.is-tip { background: color-mix(in srgb, var(--green) 11%, transparent); }
.mn-note.is-tip i { color: var(--green-ink); }
.mn-note.is-warn { background: color-mix(in srgb, var(--gold) 16%, transparent); }
.mn-note.is-warn i { color: var(--gold-ink); }
html.dark .mn-note i { color: var(--text-main); }
.mn-pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border-color); flex-wrap: wrap; }
.mn-pager a { display: flex; flex-direction: column; gap: 1px; max-width: 48%; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: var(--r-md); text-decoration: none; color: var(--text-main); }
.mn-pager a:hover { border-color: var(--sk); color: var(--text-main); }
.mn-pager a.is-next { text-align: right; margin-left: auto; }
.mn-pager small { color: var(--text-muted); font-size: .74rem; }
.mn-pager b { font-size: .87rem; }

@media (max-width: 991.98px) {
  .mn-body { grid-template-columns: minmax(0, 1fr); }
  .mn-nav { position: static; max-height: 240px; order: 2; }
  .mn-main { order: 1; }
  .mn-topic { padding: 16px; }
  .mn-pager a { max-width: 100%; flex: 1 1 100%; }
  .mn-pager a.is-next { margin-left: 0; }
}

/* ── รวมเล่ม PDF (A4) — หน้านี้ไม่ผ่าน theme จึงกำหนดสีเอง ── */
.mn-print { --text-main: #1f3a52; --text-muted: #4e6a86; --border-color: #cfe4f3; --bg-soft: #eef6fc; --green: #16a34a; --gold: #ffa95a; --sk-ink: #1a3c73;
  --green-ink: #0f6b33; --gold-ink: #8a5a05; --r-md: 8px; --shadow: none;
  font-family: 'Noto Sans Thai', 'Segoe UI', Tahoma, sans-serif; color: var(--text-main); font-size: 11.5pt; background: #fff; margin: 0; }
@page { size: A4; margin: 15mm 14mm; }
.mn-print a { color: inherit; text-decoration: none; }
.mn-cover { min-height: 245mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; break-after: page; }
.mn-cover > i { font-size: 62pt; color: #2c5ead; }
.mn-cover h1 { font-size: 25pt; margin: 18px 0 6px; font-weight: 800; }
.mn-cover h2 { font-size: 18pt; color: #2c5ead; margin: 0 0 14px; }
.mn-cover p { max-width: 130mm; line-height: 1.7; margin: 0 0 18px; }
.mn-cover small { color: var(--text-muted); }
.mn-toc { break-after: page; }
.mn-toc h2 { font-size: 18pt; font-weight: 800; margin: 0 0 8px; }
.mn-toc h3 { font-size: 12pt; font-weight: 800; margin: 12px 0 4px; }
.mn-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 8mm; font-size: 10.5pt; line-height: 1.55; list-style: none; padding: 0; }
.mn-pgroup { font-size: 17pt; font-weight: 800; color: #2c5ead; border-bottom: 2px solid #2c5ead; padding-bottom: 4px; margin: 0 0 10px; break-before: page; break-after: avoid; }
.mn-ptopic { margin-bottom: 8mm; }
.mn-ptopic h3 { font-size: 13.5pt; font-weight: 800; margin: 12px 0 6px; break-after: avoid; }
.mn-print .mn-steps li { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; padding-bottom: 5px; }
.mn-print .mn-steps { break-after: avoid; margin: 8px 0 8px; }
.mn-print .mn-fig { break-inside: avoid; margin: 0 0 10px; }
.mn-print .mn-fig img { max-height: 118mm; max-width: 100%; width: auto; }
.mn-print .mn-note, .mn-print .mn-path { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10.5pt; }
