/* ============================================================================
 *  guide.css — หน้าคู่มือการใช้งานสำหรับลูกค้า (/guide)
 * ----------------------------------------------------------------------------
 *  ใช้คู่กับ landing.css + legal.css (โหลดสองไฟล์นั้นก่อน)
 *  ตัวแปรสี/ฟอนต์/ปุ่ม/แถบบน/ท้ายเว็บ มาจาก landing.css · ตาราง .lg-table กล่อง .lg-note มาจาก legal.css
 *  ทุกคลาสในไฟล์นี้ขึ้นต้นด้วย gd- จึงไม่ชนกับหน้าอื่น
 *
 *  ลูกเล่นทั้งหมดเป็น "ของแถม" — ปิด JavaScript / ลดการเคลื่อนไหว / สั่งพิมพ์ เนื้อหายังครบทุกตัวอักษร
 *    · .gd-reveal จะซ่อนก็ต่อเมื่อ <html> มีคลาส gd-js (guide.js ใส่ให้) เท่านั้น
 *    · ไฟล์ PDF สร้างจากหน้านี้ด้วย @media print ท้ายไฟล์ (node tools/build-guide-pdf.js)
 * ========================================================================== */

/* ------------------------------------------------------------ แถบความคืบหน้า */
.gd-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  pointer-events: none;
}

/* ================================================================== HERO */
/*  overflow-x: clip (ไม่ใช่ hidden) — ตัดเฉพาะแนวนอนกันป้ายลอยล้นจอ แต่ปล่อยกล่องผลค้นหาห้อยลงพ้นขอบล่างได้ */
.gd-hero {
  position: relative; z-index: 2; overflow-x: clip;
  padding-block: clamp(48px, 7vw, 96px) clamp(40px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(700px 360px at 88% 8%, rgba(205,179,134,.22), transparent 70%),
    radial-gradient(520px 300px at 6% 100%, rgba(176,141,79,.10), transparent 70%),
    #FFFFFF;
}
.gd-crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  font-size: .813rem; font-weight: 500; color: var(--muted); margin-bottom: 1.2rem;
}
.gd-crumb a { color: var(--gold-dark); }
.gd-crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gd-crumb span[aria-hidden] { opacity: .55; }
.gd-hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.gd-hero .h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); margin-bottom: 1.1rem; }
.gd-hero .h1 .gd-mark {
  position: relative; white-space: nowrap; color: var(--ink);
  background: linear-gradient(transparent 68%, rgba(205,179,134,.45) 68%, rgba(205,179,134,.45) 92%, transparent 92%);
  background-size: 0% 100%; background-repeat: no-repeat;
  animation: gdMark 1.1s .35s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes gdMark { to { background-size: 100% 100%; } }
.gd-hero .lead { margin-bottom: 1.8rem; }
.gd-hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.6rem; }
.gd-hero-actions .btn svg { flex: none; }

/* ช่องค้นหาในคู่มือ (ใช้ได้เมื่อมี JavaScript — ไม่มีก็ซ่อนไว้) */
.gd-search { position: relative; max-width: 460px; display: none; margin-bottom: 1.1rem; }
.gd-js .gd-search { display: block; }
.gd-search input {
  width: 100%; height: 50px; padding: 0 1.1rem 0 2.9rem;
  border: 1px solid #D2D2D7; border-radius: 999px; background: #FFFFFF;
  font-size: .95rem; color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.gd-search input::placeholder { color: #9A9AA0; }
.gd-search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(176,141,79,.15); }
.gd-search svg { position: absolute; left: 1.05rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.gd-search-res {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30;
  background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: .4rem; max-height: 360px; overflow-y: auto;
}
.gd-search-res[hidden] { display: none; }
.gd-search-res a {
  display: block; padding: .6rem .8rem; border-radius: .6rem;
  font-size: .9rem; line-height: 1.5; color: var(--ink);
}
.gd-search-res a small { display: block; color: var(--muted); font-size: .78rem; }
.gd-search-res a:hover, .gd-search-res a.is-on { background: var(--gold-soft); color: var(--gold-dark); }
.gd-search-res p { padding: .7rem .8rem; font-size: .88rem; color: var(--muted); }
.gd-search-res mark { background: rgba(205,179,134,.45); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ภาพจำลองหน้าจอแอป (ตกแต่ง · aria-hidden) */
.gd-app {
  position: relative;
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  background: #FFFFFF; box-shadow: var(--shadow-lg), 0 0 0 8px rgba(255,255,255,.6);
  transform: perspective(1400px) rotateY(-7deg) rotateX(3deg);
  transition: transform .6s cubic-bezier(.2,.7,.3,1);
  font-size: 11px; line-height: 1.4; color: var(--ink-soft);
  user-select: none;
}
.gd-app:hover { transform: perspective(1400px) rotateY(0) rotateX(0); }
.gd-app-top {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border-bottom: 1px solid var(--line); background: #FBFBFC;
}
.gd-app-top i { width: 9px; height: 9px; border-radius: 50%; background: #E2E2E5; display: block; }
.gd-app-top b { margin-left: 8px; font-weight: 600; color: var(--ink); font-size: 11.5px; }
.gd-app-top b span { color: var(--gold); }
.gd-app-top em { margin-left: auto; font-style: normal; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 10px; }
.gd-app-body { display: grid; grid-template-columns: 112px minmax(0, 1fr); min-height: 268px; }
.gd-app-side { border-right: 1px solid var(--line); padding: 10px 8px; background: #FCFCFD; }
.gd-app-side span { display: block; padding: 5px 8px; border-radius: 7px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-app-side span.h { font-size: 8.5px; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-top: 6px; }
.gd-app-side span.on { background: var(--ink); color: #FFFFFF; font-weight: 600; }
.gd-app-main { padding: 12px; display: grid; gap: 10px; align-content: start; }
.gd-app-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gd-app-kpis div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; }
.gd-app-kpis small { display: block; font-size: 9px; color: var(--muted); }
.gd-app-kpis b { display: block; font-size: 14px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.gd-app-kpis div:first-child b { color: var(--gold-dark); }
.gd-app-chart {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 6px;
  height: 118px; display: flex; align-items: flex-end; gap: 7px;
}
.gd-app-chart i {
  flex: 1; display: block; border-radius: 5px 5px 2px 2px; background: #E9E5DC;
  height: var(--h, 40%); transform-origin: 50% 100%;
  animation: gdBar 1s cubic-bezier(.2,.7,.3,1) both;
}
.gd-app-chart i:nth-child(2n) { background: linear-gradient(var(--gold-light), var(--gold)); }
.gd-app-chart i:nth-child(1) { --h: 38%; animation-delay: .3s; }
.gd-app-chart i:nth-child(2) { --h: 52%; animation-delay: .38s; }
.gd-app-chart i:nth-child(3) { --h: 44%; animation-delay: .46s; }
.gd-app-chart i:nth-child(4) { --h: 66%; animation-delay: .54s; }
.gd-app-chart i:nth-child(5) { --h: 58%; animation-delay: .62s; }
.gd-app-chart i:nth-child(6) { --h: 78%; animation-delay: .70s; }
.gd-app-chart i:nth-child(7) { --h: 62%; animation-delay: .78s; }
.gd-app-chart i:nth-child(8) { --h: 92%; animation-delay: .86s; }
@keyframes gdBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.gd-app-rows { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gd-app-rows div { display: flex; justify-content: space-between; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.gd-app-rows div:last-child { border-bottom: 0; }
.gd-app-rows em { font-style: normal; font-size: 9px; padding: 1px 7px; border-radius: 999px; background: #EEF6EF; color: #2E7D46; }
.gd-app-rows em.w { background: var(--gold-soft); color: var(--gold-dark); }
/* ป้ายลอยรอบภาพ */
.gd-float {
  position: absolute; z-index: 2;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .85rem; border-radius: 999px;
  background: #FFFFFF; border: 1px solid var(--line); box-shadow: var(--shadow-md);
  font-size: .8rem; font-weight: 500; color: var(--ink); white-space: nowrap;
  animation: gdFloat 5s ease-in-out infinite;
}
.gd-float svg { color: var(--gold); }
.gd-float.f1 { left: -18px; bottom: 34px; }
.gd-float.f2 { right: 120px; top: -20px; animation-delay: -2.5s; }
@keyframes gdFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.gd-hero-art { position: relative; }

/* ---------------------------------------------------------- แถบข้อมูลคู่มือ */
.gd-meta { display: flex; flex-wrap: wrap; gap: .55rem; }
.gd-meta span {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .38rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.85); font-size: .78rem; font-weight: 500; color: var(--ink-soft);
}
.gd-meta b { color: var(--gold-dark); font-weight: 600; }

/* ======================================================== เริ่มต้นใน 4 ขั้น */
.gd-quick { padding-block: clamp(44px, 6vw, 80px) 0; }
.gd-quick-h { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; }
.gd-quick-h .h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.gd-quick-h p { color: var(--muted); max-width: 46ch; }
.gd-qsteps {
  position: relative;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem;
  counter-reset: q;
}
/* เส้นทองวิ่งเชื่อม 4 ขั้น */
.gd-qsteps::before {
  content: ''; position: absolute; left: 12%; right: 12%; top: 33px; height: 2px;
  background: linear-gradient(90deg, var(--gold-light), var(--gold), var(--gold-light));
  background-size: 200% 100%;
  animation: gdFlow 3.5s linear infinite;
  opacity: .55;
}
@keyframes gdFlow { to { background-position: -200% 0; } }
.gd-qstep {
  position: relative; counter-increment: q;
  display: block; padding: 0 1.2rem 1.4rem; text-align: center;
  border-radius: var(--r-lg);
  transition: transform .25s ease;
}
.gd-qstep:hover { transform: translateY(-4px); }
.gd-qstep::before {
  content: counter(q); position: relative; z-index: 1;
  display: grid; place-items: center; margin: 0 auto 1.1rem;
  width: 66px; height: 66px; border-radius: 50%;
  background: #FFFFFF; border: 1px solid var(--line);
  box-shadow: 0 0 0 6px #FFFFFF, var(--shadow-sm);
  font-size: 1.5rem; font-weight: 600; color: var(--gold-dark);
  font-variant-numeric: tabular-nums;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.gd-qstep:hover::before { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.gd-qstep h3 { font-size: 1.02rem; margin-bottom: .35rem; }
.gd-qstep p { font-size: .88rem; line-height: 1.7; color: var(--muted); }

/* =============================================================== เนื้อหาหลัก */
.gd-layout {
  display: grid; grid-template-columns: 264px minmax(0, 1fr);
  gap: clamp(32px, 4vw, 64px); align-items: start;
  padding-block: clamp(40px, 5vw, 72px);
}
/* สารบัญซ้าย — ต่อยอดจาก .lg-toc ของ legal.css */
.gd-toc { padding: 1.1rem 1rem 1.2rem; }
.gd-toc .lg-toc-h { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.gd-toc-pct { font-variant-numeric: tabular-nums; color: var(--muted); letter-spacing: 0; text-transform: none; font-weight: 500; }
.gd-toc a { position: relative; }
.gd-toc a.is-active { background: var(--ink); color: #FFFFFF; }
.gd-toc a.is-active::before { color: var(--gold-light); }
.gd-toc ol { padding: 0; margin: 0; }
/* ปุ่มดาวน์โหลดในสารบัญเป็น <a> ใน .lg-toc — ต้องปลดกฎตัวเลขนำหน้า/grid ของลิงก์สารบัญออก */
.lg-toc a.gd-toc-dl::before { content: none; }
.lg-toc a.gd-toc-dl {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  margin-top: .9rem; padding: .6rem .8rem; border-radius: 999px;
  border: 1px solid var(--line); font-size: .82rem; font-weight: 500; color: var(--ink);
  transition: border-color .18s ease, background .18s ease;
}
.gd-toc-dl:hover { border-color: var(--ink); background: var(--alt); }

.gd-doc { min-width: 0; counter-reset: ch; }

/* ---------------------------------------------------------------- บท */
.gd-ch { counter-increment: ch; padding-bottom: clamp(40px, 4.5vw, 64px); }
.gd-ch + .gd-ch { border-top: 1px solid var(--line); padding-top: clamp(40px, 4.5vw, 64px); }
.gd-ch-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.1rem; align-items: start; margin-bottom: 1.4rem; }
.gd-ch-num {
  display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 16px;
  background: linear-gradient(145deg, #2A2A2D, #111112);
  color: var(--gold-light); font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums;
  box-shadow: 0 14px 28px -16px rgba(17,17,17,.6), inset 0 1px 0 rgba(255,255,255,.08);
}
.gd-ch-num::before { content: counter(ch, decimal-leading-zero); }
.gd-ch-kicker { font-size: .78rem; font-weight: 500; color: var(--gold); margin-bottom: .1rem; }
.gd-ch-kicker::before { content: 'บทที่ ' counter(ch); }
.gd-ch h2 {
  font-size: clamp(1.35rem, 2.3vw, 1.75rem); letter-spacing: -.015em;
  scroll-margin-top: 96px;
}
.gd-ch-intro { margin-top: .5rem; color: var(--ink-soft); max-width: 68ch; }

/* หัวข้อย่อย */
.gd-h3 {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.12rem; font-weight: 600; color: var(--ink);
  margin: 2.2rem 0 .8rem; scroll-margin-top: 96px;
}
.gd-h3::before { content: ''; width: 18px; height: 2px; border-radius: 2px; background: var(--gold); flex: none; }
.gd-h4 { font-size: .98rem; font-weight: 600; color: var(--ink); margin: 1.4rem 0 .5rem; }
.gd-ch p { margin-bottom: .9rem; line-height: 1.9; }
.gd-ch p:last-child { margin-bottom: 0; }
.gd-ch a:not(.btn) {
  color: var(--gold-dark); font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold-light);
}
.gd-ch a:not(.btn):hover { text-decoration-color: var(--gold-dark); }

/* เส้นทางเมนู: ขาย › ใบแจ้งหนี้ */
.gd-path {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  margin: .2rem 0 1.1rem; padding: .35rem .5rem .35rem .75rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--alt);
  font-size: .82rem; color: var(--ink-soft); line-height: 1.5;
}
.gd-path > span:first-child { color: var(--muted); font-size: .76rem; }
.gd-path b {
  font-weight: 500; color: var(--ink); background: #FFFFFF;
  border: 1px solid var(--line); border-radius: 999px; padding: .12rem .62rem;
}
.gd-path i { font-style: normal; color: var(--gold); }
.gd-ui {
  display: inline-block; padding: 0 .45rem; border-radius: .4rem;
  background: var(--ink); color: #FFFFFF; font-size: .85em; font-weight: 500; line-height: 1.7;
  white-space: nowrap;
}
.gd-ui.is-light { background: #FFFFFF; color: var(--ink); border: 1px solid #D2D2D7; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 .4rem; text-align: center;
  border: 1px solid #D2D2D7; border-bottom-width: 2px; border-radius: .35rem;
  background: #FFFFFF; font-family: var(--font); font-size: .82em; font-weight: 500; color: var(--ink);
  line-height: 1.6;
}

/* ขั้นตอนแบบมีเลข + เส้นแนวตั้ง */
.gd-steps { list-style: none; margin: .4rem 0 1.2rem; padding: 0; counter-reset: st; }
.gd-steps > li {
  position: relative; counter-increment: st;
  padding: 0 0 1.15rem 3.1rem; line-height: 1.85;
}
.gd-steps > li::before {
  content: counter(st); position: absolute; left: 0; top: .1rem;
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--gold-soft); color: var(--gold-dark); border: 1px solid rgba(176,141,79,.35);
  font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: background .2s ease, color .2s ease;
}
.gd-steps > li::after {
  content: ''; position: absolute; left: calc(1rem - 1px); top: 2.35rem; bottom: .15rem;
  width: 2px; background: linear-gradient(var(--line), transparent);
}
.gd-steps > li:last-child { padding-bottom: 0; }
.gd-steps > li:last-child::after { display: none; }
.gd-steps > li:hover::before { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.gd-steps > li > b:first-child { color: var(--ink); }
.gd-steps .gd-sub { display: block; font-size: .9rem; color: var(--muted); margin-top: .15rem; }

/* รายการจุดทอง */
.gd-ul { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .45rem; }
.gd-ul li { position: relative; padding-left: 1.3rem; line-height: 1.85; }
.gd-ul li::before {
  content: ''; position: absolute; left: .25rem; top: .78em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
}
.gd-ul b { color: var(--ink); }

/* เช็กลิสต์ (มีช่องติ๊กให้กดเล่นได้ · จำในเบราว์เซอร์นี้) */
.gd-check { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.gd-check li { margin: 0; }
.gd-check label {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem; align-items: start;
  height: 100%; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--r-md);
  background: #FFFFFF; cursor: pointer; font-weight: 400; line-height: 1.65;
  transition: border-color .18s ease, background .18s ease;
}
.gd-check label:hover { border-color: var(--gold-light); }
.gd-check input { appearance: none; -webkit-appearance: none; margin: .15rem 0 0; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #C9C9CE; background: #FFFFFF; display: grid; place-items: center; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.gd-check input::after { content: ''; width: 10px; height: 6px; border: 2px solid #FFFFFF; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .18s ease; }
.gd-check input:checked { background: var(--gold); border-color: var(--gold); }
.gd-check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.gd-check input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--gold-light); }
.gd-check span b { color: var(--ink); display: block; font-weight: 600; }
.gd-check-bar { display: flex; align-items: center; gap: .8rem; margin: -.2rem 0 1.2rem; font-size: .82rem; color: var(--muted); }
.gd-check-bar div { flex: 1; height: 6px; border-radius: 999px; background: var(--alt); overflow: hidden; }
.gd-check-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width .35s ease; }
.gd-check-bar[hidden] { display: none; }

/* กล่องแนะนำ / ข้อควรระวัง / หมายเหตุ */
.gd-box {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem;
  margin: 1.2rem 0; padding: 1rem 1.15rem;
  border: 1px solid var(--line); border-radius: var(--r-md); background: #FFFFFF;
}
.gd-box > svg { flex: none; margin-top: .2rem; }
.gd-box-t { display: block; font-weight: 600; color: var(--ink); margin-bottom: .15rem; font-size: .92rem; }
.gd-box p, .gd-box li { font-size: .9rem; line-height: 1.8; }
.gd-box p { margin-bottom: .4rem; }
.gd-box p:last-child { margin-bottom: 0; }
.gd-box .gd-ul { margin: .3rem 0 0; gap: .25rem; }
.gd-box.is-tip { background: var(--gold-soft); border-color: rgba(176,141,79,.28); }
.gd-box.is-tip > svg { color: var(--gold-dark); }
.gd-box.is-warn { background: #FDF3F1; border-color: #F1D3CD; }
.gd-box.is-warn > svg { color: #B4432F; }
.gd-box.is-warn .gd-box-t { color: #8E2B22; }
.gd-box.is-note > svg { color: var(--muted); }

/* ภาพลำดับเอกสาร (flow) — จุดทองวิ่งไปตามเส้น */
.gd-flow {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 0;
  margin: 1.2rem 0 1.4rem; padding: 1.2rem;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(180deg, #FFFFFF, #FBFAF7);
}
.gd-flow-node {
  flex: 1 1 0; min-width: 120px;
  padding: .85rem .9rem; border-radius: var(--r-md);
  background: #FFFFFF; border: 1px solid var(--line); text-align: center;
  box-shadow: var(--shadow-sm);
}
.gd-flow-node small { display: block; font-size: .72rem; color: var(--muted); line-height: 1.5; }
.gd-flow-node b { display: block; color: var(--ink); font-size: .92rem; line-height: 1.45; margin: .15rem 0; }
.gd-flow-node em { font-style: normal; display: inline-block; margin-top: .25rem; font-size: .72rem; padding: .05rem .55rem; border-radius: 999px; background: var(--alt); color: var(--muted); }
.gd-flow-node.is-key { border-color: var(--gold-light); background: var(--gold-soft); }
.gd-flow-node.is-key em { background: #FFFFFF; color: var(--gold-dark); }
.gd-flow-arrow {
  position: relative; flex: 0 0 38px; align-self: center; height: 2px; margin: 0 2px;
  background: #DCD6CA; overflow: visible;
}
.gd-flow-arrow::after {
  content: ''; position: absolute; right: -1px; top: -4px;
  border: 5px solid transparent; border-left-color: #DCD6CA; border-right: 0;
}
.gd-flow-arrow::before {
  content: ''; position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px rgba(176,141,79,.18);
  animation: gdDot 2.4s ease-in-out infinite;
}
@keyframes gdDot { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 8px); opacity: 0; } }

/* ภาพหน้าจอจำลองที่มีหมายเลขชี้จุด */
.gd-shot {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 1.4rem;
  margin: 1.2rem 0 1.4rem; align-items: start;
}
.gd-screen {
  position: relative; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: #FFFFFF; box-shadow: var(--shadow-md); font-size: 11px; line-height: 1.4;
}
.gd-screen-top { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.gd-screen-top b { font-weight: 600; color: var(--ink); font-size: 12px; }
.gd-screen-top b span { color: var(--gold); }
.gd-screen-top .co { margin-left: auto; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; }
.gd-screen-top .sw { padding: 3px 10px; border-radius: 999px; background: var(--ink); color: #FFFFFF; font-size: 10px; }
.gd-screen-body { display: grid; grid-template-columns: 128px minmax(0, 1fr); min-height: 250px; }
.gd-screen-side { padding: 9px 8px; border-right: 1px solid var(--line); background: #FCFCFD; }
.gd-screen-side .s { height: 24px; border-radius: 999px; border: 1px solid var(--line); background: #FFFFFF; margin-bottom: 8px; padding: 0 8px; display: flex; align-items: center; color: #A0A0A6; font-size: 9.5px; }
.gd-screen-side span { display: block; padding: 4px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
.gd-screen-side span.h { font-size: 8.5px; color: var(--muted); letter-spacing: .08em; margin-top: 5px; font-weight: 600; }
.gd-screen-side span.on { background: var(--ink); color: #FFFFFF; }
.gd-screen-main { padding: 11px; display: grid; gap: 9px; align-content: start; }
.gd-screen-main .t { font-size: 13px; font-weight: 600; color: var(--ink); }
.gd-screen-main .k { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.gd-screen-main .k i { display: block; height: 42px; border-radius: 9px; border: 1px solid var(--line); background: #FFFFFF; }
.gd-screen-main .k i:first-child { background: var(--gold-soft); border-color: rgba(176,141,79,.3); }
.gd-screen-main .g { height: 84px; border-radius: 9px; border: 1px solid var(--line); background: repeating-linear-gradient(90deg, #FFFFFF 0 22px, #F4F2ED 22px 23px); }
.gd-screen-main .r { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.gd-screen-main .r i { display: block; height: 46px; border-radius: 9px; border: 1px solid var(--line); }
/* หมายเลขชี้จุด */
.gd-pin {
  position: absolute; z-index: 2;
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: #FFFFFF; font-size: 12px; font-weight: 600;
  box-shadow: 0 0 0 4px rgba(176,141,79,.22), 0 6px 14px -6px rgba(17,17,17,.5);
  cursor: default; transition: transform .2s ease, background .2s ease;
}
.gd-pin::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--gold); opacity: 0; animation: gdPing 2.4s ease-out infinite;
}
@keyframes gdPing { 0% { transform: scale(.8); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
.gd-pin.is-on { background: var(--ink); transform: scale(1.15); }
.gd-pin.p1 { left: 54px; top: 46px; }
.gd-pin.p2 { left: 58px; top: 118px; }
.gd-pin.p3 { right: 34px; top: 30px; }
.gd-pin.p4 { left: 54%; top: 100px; }
.gd-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; counter-reset: lg; }
.gd-legend li {
  counter-increment: lg; position: relative;
  padding: .75rem .9rem .75rem 2.9rem; border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: .88rem; line-height: 1.7; background: #FFFFFF;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.gd-legend li::before {
  content: counter(lg); position: absolute; left: .85rem; top: .8rem;
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); color: #FFFFFF; font-size: .75rem; font-weight: 600;
}
.gd-legend li b { color: var(--ink); display: block; }
.gd-legend li.is-on { border-color: var(--gold); box-shadow: var(--shadow-sm); transform: translateX(3px); }

/* การ์ดเลือกแบบ (เช่น ประเภทธุรกิจ) */
.gd-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin: 1rem 0 1.2rem; }
.gd-cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gd-card {
  position: relative; padding: 1.1rem 1.15rem 1.15rem; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: #FFFFFF; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.gd-card:hover { border-color: var(--gold-light); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.gd-card-tag { display: inline-block; font-size: .72rem; font-weight: 500; padding: .1rem .6rem; border-radius: 999px; background: var(--gold-soft); color: var(--gold-dark); margin-bottom: .55rem; }
.gd-card h4 { font-size: 1rem; margin-bottom: .4rem; }
.gd-card p, .gd-card li { font-size: .88rem; line-height: 1.75; }
.gd-card .gd-ul { margin: .4rem 0 0; gap: .2rem; }

/* ตารางกำหนดยื่นภาษี + เส้นเวลา 1–31 */
.gd-cal { margin: 1.2rem 0 1.4rem; padding: 1.3rem 1.2rem 1.1rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: #FFFFFF; }
.gd-cal-h { font-size: .8rem; color: var(--muted); margin-bottom: 2.6rem; }
.gd-cal-track { position: relative; height: 8px; border-radius: 999px; background: var(--alt); margin: 0 10px 2.6rem; }
.gd-cal-track::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; transform-origin: 0 50%;
  background: linear-gradient(90deg, #EEE7DA, var(--gold-light));
  transform: scaleX(0); transition: transform 1.4s cubic-bezier(.2,.7,.3,1);
}
.gd-cal.in .gd-cal-track::before, .gd-nojs .gd-cal-track::before { transform: scaleX(1); }
.gd-cal-m { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.gd-cal-m i { display: block; width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF; border: 3px solid var(--gold); box-shadow: 0 0 0 4px rgba(176,141,79,.15); }
.gd-cal-m b { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .8rem; color: var(--ink); font-weight: 600; }
.gd-cal-m span { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .74rem; color: var(--muted); text-align: center; line-height: 1.45; }
.gd-cal-m.d7 { left: calc(6 / 30 * 100%); }
.gd-cal-m.d15 { left: calc(14 / 30 * 100%); }
.gd-cal-m.d23 { left: calc(22 / 30 * 100%); }
.gd-cal-m.d23 i { border-color: var(--ink); }
.gd-cal-ends { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin: 0 4px; }

/* ตาราง — ต่อยอด .lg-table */
.gd-table { margin: .8rem 0 1.2rem; }
.gd-table td:first-child { white-space: normal; }
.gd-table .tag { display: inline-block; font-size: .72rem; padding: .05rem .55rem; border-radius: 999px; background: var(--alt); color: var(--ink-soft); font-weight: 500; white-space: nowrap; }
.gd-table .tag.is-g { background: var(--gold-soft); color: var(--gold-dark); }
.gd-table .tag.is-x { background: #F4F4F5; color: var(--muted); }

/* ป้าย "ฟังก์ชันเสริม" / "เฉพาะธุรกิจซื้อมาขายไป" */
.gd-badge {
  display: inline-flex; align-items: center; gap: .3rem; vertical-align: middle;
  margin-left: .45rem; padding: .08rem .6rem; border-radius: 999px;
  font-size: .72rem; font-weight: 500; letter-spacing: 0; line-height: 1.6;
  border: 1px solid rgba(176,141,79,.4); color: var(--gold-dark); background: #FFFFFF;
}
.gd-badge.is-dark { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

/* ติดต่อเจ้าหน้าที่ */
.gd-contact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-top: 1.2rem; }
.gd-contact a {
  display: grid; gap: .2rem; padding: 1.1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: #FFFFFF; text-decoration: none !important; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.gd-contact a:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.gd-contact small { font-size: .76rem; color: var(--muted); font-weight: 400; }
.gd-contact b { color: var(--ink); font-size: 1rem; font-weight: 600; }
.gd-contact svg { color: var(--gold); margin-bottom: .3rem; }

/* ปุ่มกลับขึ้นบน */
.gd-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--ink); color: #FFFFFF;
  box-shadow: 0 16px 30px -14px rgba(17,17,17,.6);
  opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
}
.gd-top.is-show { opacity: 1; transform: none; pointer-events: auto; }
.gd-top:hover { background: #000000; }
.gd-top svg { position: relative; z-index: 1; }
.gd-top-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.gd-top-ring circle { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; }

/* ไฮไลต์หัวข้อที่กระโดดไปจากการค้นหา */
.gd-flash { animation: gdFlash 1.8s ease; border-radius: .5rem; }
@keyframes gdFlash { 0%, 30% { background: rgba(205,179,134,.38); box-shadow: 0 0 0 8px rgba(205,179,134,.38); } 100% { background: transparent; box-shadow: 0 0 0 8px transparent; } }

/* ปรากฏเมื่อเลื่อนถึง — ซ่อนเฉพาะเมื่อ JavaScript ทำงาน */
.gd-js .gd-reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.gd-js .gd-reveal.in { opacity: 1; transform: none; }

/* ส่วนที่มีเฉพาะในไฟล์ PDF */
.gd-print-only { display: none; }

/* =================================================================== จอแคบ */
@media (max-width: 1080px) {
  .gd-hero-grid { grid-template-columns: 1fr; }
  .gd-hero-art { max-width: 560px; }
  .gd-app { transform: none; }
  .gd-shot { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .gd-layout { grid-template-columns: 1fr; gap: 28px; }
  .gd-toc { position: static; max-height: none; overflow: visible; }
  .gd-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gd-qsteps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.6rem; }
  .gd-qsteps::before { display: none; }
  .gd-cards.c3 { grid-template-columns: 1fr 1fr; }
  .gd-contact { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .gd-toc ol { grid-template-columns: 1fr; }
  .gd-check, .gd-cards, .gd-cards.c3 { grid-template-columns: 1fr; }
  .gd-flow { flex-direction: column; padding: 1rem; }
  .gd-flow-arrow { flex: 0 0 26px; width: 2px; height: 26px; align-self: center; margin: 2px 0; }
  .gd-flow-arrow::after { right: auto; left: -4px; top: auto; bottom: -1px; border: 5px solid transparent; border-top-color: #DCD6CA; border-bottom: 0; }
  .gd-flow-arrow::before { left: -3px; animation-name: gdDotV; }
  .gd-float { display: none; }
  .gd-ch-head { grid-template-columns: 1fr; gap: .8rem; }
  .gd-ch-num { width: 48px; height: 48px; border-radius: 13px; font-size: 1.1rem; }
  .gd-steps > li { padding-left: 2.7rem; }
  /*  จอแคบ ป้ายใต้หมุดชนกัน — เหลือแค่วันที่ รายละเอียดอยู่ในตารางถัดไปแล้ว */
  .gd-cal-m b { font-size: .75rem; }
  .gd-cal-m span { display: none; }
  .gd-cal-track { margin-bottom: 1.2rem; }
  .gd-top { right: 16px; bottom: 16px; }
}
@keyframes gdDotV { 0% { top: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: calc(100% - 8px); opacity: 0; } }
@media (max-width: 460px) {
  .gd-qsteps { grid-template-columns: 1fr; }
  .gd-hero-actions .btn { flex: 1 1 100%; }
  .gd-app-body { grid-template-columns: 88px minmax(0, 1fr); }
  .gd-screen-body { grid-template-columns: 96px minmax(0, 1fr); }
  .gd-pin.p4 { left: 60%; }
}

@media (prefers-reduced-motion: reduce) {
  .gd-hero .h1 .gd-mark { background-size: 100% 100%; animation: none; }
  .gd-app-chart i, .gd-float, .gd-flow-arrow::before, .gd-pin::after, .gd-qsteps::before { animation: none !important; }
  .gd-js .gd-reveal { opacity: 1; transform: none; }
}

/* ============================================================== สั่งพิมพ์ / PDF
 *  ไฟล์ /assets/cleantax-guide.pdf สร้างจากส่วนนี้ (tools/build-guide-pdf.js)
 *  · หน้าปก + สารบัญ แยกหน้า · แต่ละบทขึ้นหน้าใหม่ · ปิดลูกเล่นทั้งหมด
 * ========================================================================== */
@page { size: A4; margin: 16mm 15mm 18mm; }
@page :first { margin: 0; }
@page {
  @bottom-center { content: counter(page); font-family: 'Cleantax Text', sans-serif; font-size: 9pt; color: #8A8A8F; }
  @bottom-right { content: 'คู่มือการใช้งาน CleanTax'; font-family: 'Cleantax Text', sans-serif; font-size: 8pt; color: #B0B0B5; }
}
@page :first { @bottom-center { content: none; } @bottom-right { content: none; } }

@media print {
  html { scroll-behavior: auto; }
  body { font-size: 10.5pt; line-height: 1.75; color: #2A2A2D; background: #FFFFFF; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .site-header, .site-footer, .gd-progress, .gd-top, .gd-search, .gd-hero, .gd-toc, .gd-quick, .gd-no-print, .lg-toc { display: none !important; }
  .gd-print-only { display: block; }
  .gd-reveal, .gd-js .gd-reveal { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wrap { max-width: none; padding: 0; }
  .gd-layout { display: block; padding: 0; }

  /* หน้าปก */
  .gd-cover {
    display: flex; flex-direction: column; justify-content: space-between;
    height: 297mm; padding: 26mm 22mm 22mm; page-break-after: always; break-after: page;
    /*  สีทึบล้วน ไม่ใช้ความโปร่งใส — โปรแกรมอ่าน PDF บางตัววาดไล่สีโปร่งใสเพี้ยนเป็นชมพู */
    background:
      radial-gradient(130mm 90mm at 92% 4%, #F1E8D8, #FFFFFF 70%) no-repeat;
    border-top: 3mm solid var(--gold);
  }
  /*  ⚠️ โลโก้ต้องอยู่ในกล่องห่อ + กำหนดทั้งกว้างและสูงตามสัดส่วนจริง (468×322 ≈ 1.453)
   *     วาง <img> ตรงๆ ในกล่อง flex แนวตั้ง รูปจะถูกยืดเต็มความกว้างหน้ากระดาษ (เจอ 11 พ.ย. 2569) */
  .gd-cover-logo { display: block; width: 48mm; height: 33mm; }
  .gd-cover-logo img { display: block; width: 48mm !important; height: 33mm !important; max-width: none; object-fit: contain; }
  .gd-cover-k { font-size: 11pt; color: var(--gold-dark); font-weight: 500; letter-spacing: .02em; margin-bottom: 4mm; }
  .gd-cover h1 { font-size: 34pt; line-height: 1.22; margin-bottom: 6mm; }
  .gd-cover h1 span { color: var(--gold-dark); }
  .gd-cover p { font-size: 12pt; color: #515154; max-width: 140mm; }
  .gd-cover-line { width: 40mm; height: 2px; background: var(--gold); margin: 8mm 0; }
  .gd-cover-meta { display: flex; gap: 10mm; font-size: 9.5pt; color: #6E6E73; border-top: 1px solid #E8E8EA; padding-top: 5mm; }
  .gd-cover-meta b { display: block; color: #1D1D1F; font-size: 10.5pt; }

  /* สารบัญในไฟล์ PDF */
  .gd-ptoc { page-break-after: always; break-after: page; padding-top: 4mm; }
  .gd-ptoc h2 { font-size: 20pt; margin-bottom: 2mm; }
  .gd-ptoc > p { color: #6E6E73; margin-bottom: 8mm; font-size: 10pt; }
  .gd-ptoc ol { list-style: none; padding: 0; margin: 0; counter-reset: pt; }
  .gd-ptoc li { counter-increment: pt; display: grid; grid-template-columns: 14mm minmax(0, 1fr); padding: 2.2mm 0; border-bottom: 1px solid #ECECEE; font-size: 10.5pt; line-height: 1.5; }
  .gd-ptoc li::before { content: counter(pt, decimal-leading-zero); color: var(--gold-dark); font-weight: 600; }
  .gd-ptoc li b { color: #1D1D1F; font-weight: 600; }
  .gd-ptoc li span { display: block; font-size: 9pt; color: #8A8A8F; }

  .gd-ch { page-break-before: always; break-before: page; padding: 0 !important; border: 0 !important; }
  .gd-ch-num { box-shadow: none; }
  .gd-h3, .gd-h4, .gd-ch-head { page-break-after: avoid; break-after: avoid; }
  .gd-box, .gd-flow, .gd-card, .gd-shot, .gd-cal, .gd-check li, .gd-legend li, .gd-steps > li, .lg-table tr, .faq details { page-break-inside: avoid; break-inside: avoid; }
  .gd-shot { grid-template-columns: 1.1fr .9fr; }
  .gd-screen, .gd-card, .gd-flow-node { box-shadow: none; }
  .gd-pin::after { display: none; }
  .gd-cal-track::before { transform: scaleX(1); }
  .gd-flow-arrow::before { display: none; }
  .gd-check input { border-color: #9A9AA0; }
  .gd-check-bar { display: none; }
  .gd-contact { grid-template-columns: repeat(3, 1fr); }
  .faq details > *:not(summary) { display: block; }
  .faq summary::after { display: none; }
  .gd-ch a:not(.btn) { text-decoration: none; color: inherit; }
  .lg-table { font-size: 9pt; }
}
