/* Smart Cartoon Studio — ໜ້າຄູ່ມືການໃຊ້ ແລະ ນະໂຍບາຍ.
 * ໃຊ້ຮ່ວມກັບ style.css + account.css (ສີ, ປຸ່ມ, ຫົວເວັບ).
 */

.docs-main {
  width: min(1180px, calc(100% - 32px));
  padding-top: 22px;
}

/* ---------- Hero ---------- */
.docs-hero {
  position: relative;
  overflow: hidden;
  padding: 28px clamp(20px, 4vw, 42px);
  border: 2px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(circle at 96% 4%, rgba(249, 115, 22, 0.16), transparent 30%),
    radial-gradient(circle at 2% 100%, rgba(13, 148, 136, 0.12), transparent 34%),
    var(--paper);
  box-shadow: 0 7px 0 rgba(43, 27, 61, 0.12);
}
.docs-hero::after {
  content: attr(data-emoji);
  position: absolute;
  right: 22px;
  top: 12px;
  font-size: clamp(58px, 9vw, 96px);
  line-height: 1;
  opacity: 0.13;
  transform: rotate(-9deg);
  pointer-events: none;
}
.docs-hero .eyebrow { display: inline-block; }
.docs-hero h1 {
  max-width: 22ch;
  margin: 8px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.18;
  letter-spacing: -0.01em;
}
.docs-hero .docs-lead {
  max-width: 68ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.7;
}
.docs-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
}
.docs-badge {
  padding: 5px 11px;
  border: 1.5px solid rgba(43, 27, 61, 0.16);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
}
.docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

/* ---------- ຄົ້ນຫາ ---------- */
.docs-search {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin-top: 18px;
}
.docs-search input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 2px solid rgba(43, 27, 61, 0.2);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}
.docs-search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16); }
.docs-search button {
  min-height: 46px;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: var(--paper-2);
  font-size: 13px;
  font-weight: 800;
}
.docs-search-note {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
}
.docs-empty {
  padding: 22px;
  border: 2px dashed rgba(43, 27, 61, 0.25);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.65);
  color: var(--ink-2);
  text-align: center;
  font-size: 13.5px;
}

/* ---------- ໂຄງສ້າງ 2 ຖັນ ---------- */
.docs-layout {
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}
.docs-toc {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 15px 13px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 250, 240, 0.97);
  box-shadow: 0 5px 0 rgba(43, 27, 61, 0.1);
  scrollbar-width: thin;
}
.docs-toc > strong {
  display: block;
  padding: 0 8px 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
}
.docs-toc nav { display: grid; gap: 1px; }
.docs-toc a {
  display: block;
  padding: 7px 9px;
  border-left: 3px solid transparent;
  border-radius: 0 9px 9px 0;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.docs-toc a:hover { background: var(--paper-2); color: var(--ink); }
.docs-toc a.is-active {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 800;
}
.docs-toc a.toc-sub { padding-left: 20px; font-size: 11.5px; font-weight: 600; }
.docs-toc-help {
  margin-top: 12px;
  padding: 11px 9px 2px;
  border-top: 1.5px dashed rgba(43, 27, 61, 0.16);
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.55;
}
.docs-toc-help a { padding: 0; border: 0; background: none; color: var(--accent-ink); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- ເນື້ອຫາ ---------- */
.docs-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}
.docs-section {
  scroll-margin-top: 16px;
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 32px);
  border: 2px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(43, 27, 61, 0.1);
}
.docs-section > :first-child { margin-top: 0; }
.docs-section > :last-child { margin-bottom: 0; }
.docs-section h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.3;
}
.docs-section h2 .docs-num {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 3px 0 rgba(43, 27, 61, 0.12);
}
.docs-section h3 {
  margin: 20px 0 6px;
  font-size: 16px;
  line-height: 1.4;
}
.docs-section h4 {
  margin: 16px 0 4px;
  font-size: 13.5px;
  line-height: 1.4;
}
.docs-section p { margin: 8px 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.75; }
.docs-section ul,
.docs-section ol { margin: 8px 0; padding-left: 22px; color: var(--ink-2); font-size: 13.5px; line-height: 1.75; }
.docs-section li + li { margin-top: 4px; }
.docs-section li::marker { color: var(--accent); font-weight: 800; }
.docs-section strong { color: var(--ink); }
.docs-section a { color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.docs-section a:hover { color: var(--accent); }
.docs-section code {
  padding: 1px 6px;
  border: 1px solid rgba(43, 27, 61, 0.14);
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 0.92em;
}

/* ຂັ້ນຕອນແບບມີເລກ */
.docs-steps { counter-reset: step; margin: 12px 0; padding: 0; list-style: none; }
.docs-steps > li {
  position: relative;
  padding: 0 0 0 38px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.7;
}
.docs-steps > li + li { margin-top: 10px; }
.docs-steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 900;
}

/* ກ່ອງແຈ້ງເຕືອນ */
.docs-callout {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1.5px solid rgba(43, 27, 61, 0.16);
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 12.8px;
  line-height: 1.65;
}
.docs-callout strong { color: var(--ink); }
.docs-callout.is-tip { border-left-color: var(--accent-2); background: rgba(13, 148, 136, 0.08); }
.docs-callout.is-warn { border-left-color: var(--danger); background: rgba(225, 29, 72, 0.07); }
.docs-callout.is-info { border-left-color: #7c3aed; background: rgba(124, 58, 237, 0.07); }

/* ຕາຕະລາງ */
.docs-table-wrap { margin: 12px 0; max-width: 100%; overflow-x: auto; border: 1.5px solid rgba(43, 27, 61, 0.15); border-radius: 13px; }
.docs-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  background: #fff;
  font-size: 12.8px;
  line-height: 1.55;
}
.docs-table th,
.docs-table td { padding: 9px 12px; border-bottom: 1px solid rgba(43, 27, 61, 0.1); text-align: left; vertical-align: top; }
.docs-table th { background: var(--paper-2); color: var(--ink); font-weight: 800; white-space: nowrap; }
.docs-table tr:last-child td { border-bottom: 0; }
.docs-table td { color: var(--ink-2); }

/* Mini cards */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.docs-mini-card {
  padding: 13px;
  border: 1.5px solid rgba(43, 27, 61, 0.14);
  border-radius: 14px;
  background: var(--paper-2);
}
.docs-mini-card strong { display: block; margin-bottom: 3px; font-size: 13px; }
.docs-mini-card span { display: block; color: var(--ink-2); font-size: 12px; line-height: 1.55; }

/* FAQ */
.docs-faq { display: grid; gap: 8px; margin-top: 12px; }
.docs-faq details {
  border: 1.5px solid rgba(43, 27, 61, 0.14);
  border-radius: 13px;
  background: var(--paper-2);
  overflow: hidden;
}
.docs-faq summary {
  padding: 11px 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  cursor: pointer;
  list-style: none;
}
.docs-faq summary::-webkit-details-marker { display: none; }
.docs-faq summary::before { content: "＋"; display: inline-block; margin-right: 7px; color: var(--accent); font-weight: 900; }
.docs-faq details[open] summary::before { content: "−"; }
.docs-faq details[open] summary { background: rgba(249, 115, 22, 0.08); }
.docs-faq .faq-body { padding: 0 14px 13px; color: var(--ink-2); font-size: 12.8px; line-height: 1.7; }
.docs-faq .faq-body p { margin: 4px 0; font-size: 12.8px; }

/* ກ່ອງສະຫຼຸບ / CTA */
.docs-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.docs-summary-card {
  padding: 14px;
  border: 1.5px solid rgba(43, 27, 61, 0.15);
  border-radius: 15px;
  background: var(--paper-2);
}
.docs-summary-card .ico { font-size: 20px; line-height: 1; }
.docs-summary-card strong { display: block; margin: 5px 0 2px; font-size: 12.5px; }
.docs-summary-card span { display: block; color: var(--ink-2); font-size: 11.8px; line-height: 1.55; }
.docs-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 2px dashed rgba(43, 27, 61, 0.22);
  border-radius: 17px;
  background: var(--paper-2);
}
.docs-cta p { margin: 0; font-size: 13px; }
.docs-cta .docs-actions { margin: 0; }

/* ປ້າຍກຳກັບ */
.docs-pill {
  display: inline-block;
  padding: 2px 8px;
  border: 1.5px solid rgba(43, 27, 61, 0.18);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 800;
  vertical-align: middle;
}
.docs-pill.is-ok { border-color: rgba(21, 128, 61, 0.35); background: rgba(21, 128, 61, 0.1); color: var(--ok); }
.docs-pill.is-warn { border-color: rgba(225, 29, 72, 0.35); background: rgba(225, 29, 72, 0.09); color: var(--danger); }

/* ປຸ່ມກັບຂຶ້ນເທິງ */
.docs-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(43, 27, 61, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.docs-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }

/* ລາຍການພາກສ່ວນໃນໜ້ານະໂຍບາຍ */
.policy-block + .policy-block { margin-top: 14px; padding-top: 14px; border-top: 1.5px dashed rgba(43, 27, 61, 0.14); }
.policy-block h3 { margin-top: 0; }
.policy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 12px 0 0;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 600;
}

/* ---------- ມືຖື ---------- */
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-toc {
    position: static;
    max-height: 46vh;
    padding: 13px;
  }
  .docs-toc > strong { padding-bottom: 6px; }
  .docs-toc nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-toc a { font-size: 12px; }
  .docs-toc a.toc-sub { padding-left: 12px; }
  .docs-toc-help { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .docs-main { width: calc(100% - 20px); padding-top: 12px; }
  .docs-hero { padding: 20px 16px; border-radius: 20px; }
  .docs-hero h1 { font-size: 27px; }
  .docs-hero .docs-lead { font-size: 13px; }
  .docs-actions .btn { flex: 1 1 auto; justify-content: center; }
  .docs-search { grid-template-columns: 1fr; }
  .docs-search button { display: none; }
  .docs-toc nav { grid-template-columns: 1fr; }
  .docs-section { padding: 18px 15px; border-radius: 18px; }
  .docs-section h2 { font-size: 20px; }
  .docs-section p,
  .docs-section ul,
  .docs-section ol,
  .docs-steps > li { font-size: 13px; }
  .docs-top { right: 12px; bottom: 12px; }
}

/* ---------- ພິມ ---------- */
@media print {
  .account-topbar,
  .docs-toc,
  .docs-actions,
  .docs-search,
  .docs-search-note,
  .docs-top,
  .bb-project-footer { display: none !important; }
  body.account-page { background: #fff !important; }
  .docs-main { width: 100%; padding: 0; }
  .docs-hero,
  .docs-section { break-inside: avoid-page; border-color: #999; box-shadow: none; }
  .docs-layout { display: block; }
  .docs-content { margin-top: 12px; }
  .docs-section { margin-top: 10px; }
  .docs-faq details { break-inside: avoid; }
  .docs-faq details:not([open]) .faq-body { display: block; }
  a { text-decoration: none !important; }
}

/* ເລີ່ມໄວ 3 ຂັ້ນຕອນ */
.quick-start { border: 3px solid #f97316; border-radius: 20px; background: #fff7ed; }
.quick-steps { display: grid; gap: 10px; margin: 10px 0; padding: 0; list-style: none; counter-reset: q; }
.quick-steps li { display: grid; gap: 2px; padding: 12px 14px 12px 52px; position: relative; border-radius: 14px; background: #fff; border: 2px solid rgba(43, 27, 61, 0.1); counter-increment: q; }
.quick-steps li::before { content: counter(q); position: absolute; left: 12px; top: 12px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #f97316; color: #fff; font-weight: 900; }
.quick-steps strong { font-size: 17px; }
.quick-note { margin: 6px 0 0; font-size: 14px; }
