/* ==========================================================================
   คู่มือลูกค้า /guide — ปรับใหม่ 1 พ.ย. 2569 (เจ้าของ: ตาม template ของร้าน ให้สวย กระชับ)
   ทุกหัวข้อเป็นการ์ดเดียว (อ่านได้บนพื้นหลังภาพทุก template) · สีมาจากตัวแปร --g-* ต่อ theme
   class ที่ mango-guide.js สร้าง: guide-level, gl-unlock, gpr-head/bar/need, gs-step, gs-lvN, gs-name, gs-rate, gs-unlock, gs-you, is-paused
   ========================================================================== */
.guide-page {
    --g-accent: #ea580c; --g-accent2: #f59e0b; --g-deep: #9a3412; --g-ink: #3b2f1c; --g-muted: #6b5b43;
    --g-card: rgba(255, 255, 255, .97); --g-line: #f0dcb6; --g-soft: #fff6e5; --g-ok: #15803d; --g-ok-soft: #ecfdf3;
    --g-hero: linear-gradient(135deg, #ff7a00, #ffb020); --g-hero-ink: #fff; --g-phone: #2b2620; --g-navbg: rgba(255, 244, 222, .82);
    max-width: 720px; margin: 0 auto; padding: 10px 12px 32px; color: var(--g-ink); font-size: 16px; line-height: 1.65;
}
html[data-theme="emerald"] .guide-page {
    --g-accent: #047857; --g-accent2: #d4a017; --g-deep: #065f46; --g-ink: #10291f; --g-muted: #4b6358;
    --g-line: #d9e8c8; --g-soft: #f1f8ec; --g-hero: linear-gradient(135deg, #064e3b, #047857 60%, #b8860b); --g-phone: #0b2a20; --g-navbg: rgba(6, 46, 34, .78);
}
html[data-theme="black"] .guide-page {
    --g-accent: #b8860b; --g-accent2: #f5c542; --g-deep: #7a5a00; --g-ink: #1f1a10; --g-muted: #5e5440;
    --g-line: #ead9a8; --g-soft: #fbf5e3; --g-hero: linear-gradient(135deg, #0b0b0b, #2a2208 65%, #8a6a12); --g-hero-ink: #f8e7b0; --g-phone: #111; --g-navbg: rgba(10, 10, 10, .78);
}
.guide-page [hidden] { display: none !important; }
.guide-page p { font-size: 16px; line-height: 1.65; margin: 0 0 8px; }
.guide-page b, .guide-page strong { font-weight: 800; }
.guide-page button, .guide-page a { font-family: inherit; }
.guide-page button:focus-visible, .guide-page a:focus-visible, .guide-page summary:focus-visible { outline: 3px solid var(--g-accent2); outline-offset: 3px; }

/* ---------- ส่วนหัว: การ์ดไล่สี อ่านได้ทุกพื้นหลัง ---------- */
.guide-hero { position: relative; overflow: hidden; padding: 16px 16px 10px; border-radius: 22px; background: var(--g-hero); color: var(--g-hero-ink); box-shadow: 0 14px 30px -20px rgba(0, 0, 0, .55); }
.guide-hero:after { content: ""; position: absolute; right: -40px; top: -50px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .14); pointer-events: none; }
.guide-kicker { position: relative; font-size: 13px !important; font-weight: 700; opacity: .92; margin: 0 0 2px !important; }
.guide-page h1 { position: relative; font-size: 26px; line-height: 1.3; margin: 0 0 12px; font-weight: 900; color: inherit; }
.guide-page h1 span { display: block; font-size: 16px; font-weight: 700; opacity: .9; }
.guide-quick { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.guide-quick li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 14px; background: rgba(255, 255, 255, .18); font-size: 13.5px; font-weight: 800; text-align: center; line-height: 1.3; }
.guide-quick li ion-icon { font-size: 22px; }
.guide-motion { position: relative; display: block; margin: 6px auto 0; background: none; border: 0; color: inherit; opacity: .8; font-size: 12.5px; text-decoration: underline; min-height: 32px; cursor: pointer; }

/* ---------- แถบหัวข้อ: ชิปเลื่อนแนวนอน ติดบนจอ ---------- */
.guide-topics { position: sticky; top: 56px; z-index: 5; display: flex; gap: 6px; margin: 10px -12px 0; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.guide-topics { background: var(--g-navbg); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.guide-topics::-webkit-scrollbar { display: none; }
.guide-topics a { flex-shrink: 0; position: relative; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--g-card); border: 1px solid var(--g-line); color: var(--g-deep); font-size: 14.5px; font-weight: 800; white-space: nowrap; text-decoration: none; box-shadow: 0 4px 12px -8px rgba(0, 0, 0, .45); }
.guide-topics a.is-on { background: var(--g-accent); border-color: var(--g-accent); color: #fff; }
.guide-topics a.gt-new:after { content: ""; position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; }
html[data-theme="emerald"] .guide-topics { position: static; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }   /* emerald ไม่มีแถบหัว ปุ่มลอยมุมจอ — ไม่ตรึงแถบหัวข้อ */

/* ---------- การ์ดหัวข้อ ---------- */
.guide-section { margin-top: 12px; padding: 14px 14px 12px; border-radius: 20px; background: var(--g-card); border: 1px solid var(--g-line); box-shadow: 0 10px 24px -20px rgba(60, 40, 0, .6); scroll-margin-top: 112px; }
.guide-page h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 900; line-height: 1.35; margin: 0 0 10px; color: var(--g-ink); }
.gh-ico { flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--g-hero); color: #fff; }
html[data-theme="black"] .gh-ico { color: #f5c542; }
.gh-ico ion-icon { font-size: 20px; }
.guide-page h3 { font-size: 17px; font-weight: 800; line-height: 1.45; margin: 0 0 8px; }
.guide-page .guide-sub { font-size: 14px; color: var(--g-muted); margin: 0 0 6px; }
.guide-link { display: inline-flex; align-items: center; min-height: 40px; margin-top: 4px; color: var(--g-deep); font-weight: 800; font-size: 15.5px; text-decoration: none; }
.guide-link:hover { color: var(--g-accent); }

/* ขั้นตอนแบบกระชับ: เลขวงกลม + หัวข้อ + คำอธิบายบรรทัดเดียวสองบรรทัด */
.guide-steps { list-style: none; counter-reset: gstep; margin: 0; padding: 0; display: grid; gap: 0; }
.guide-steps li { counter-increment: gstep; position: relative; padding: 8px 0 8px 42px; border-top: 1px dashed var(--g-line); }
.guide-steps li:first-child { border-top: 0; padding-top: 2px; }
.guide-steps li:before { content: counter(gstep); position: absolute; left: 0; top: 7px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--g-hero); color: #fff; font-size: 15px; font-weight: 900; }
.guide-steps li:first-child:before { top: 1px; }
html[data-theme="black"] .guide-steps li:before { color: #f5c542; }
.guide-steps b { display: block; font-size: 16px; line-height: 1.45; }
.guide-steps p { font-size: 14.5px; line-height: 1.6; color: var(--g-muted); margin: 2px 0 0; }
.guide-steps p b { display: inline; font-size: inherit; color: var(--g-ink); }

.guide-tip { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0 !important; padding: 9px 12px; border-radius: 12px; background: var(--g-soft); color: var(--g-ink); font-weight: 700; font-size: 14.5px !important; line-height: 1.55 !important; }
.guide-tip ion-icon { flex-shrink: 0; font-size: 19px; margin-top: 1px; color: var(--g-accent); }
.guide-tip-warn { background: #fef2f2; color: #991b1b; }
.guide-tip-warn ion-icon { color: #dc2626; }

/* ประวัติซื้อ / ตรวจผล: 2 ช่องกดได้ */
.guide-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.guide-tile { display: flex; flex-direction: column; gap: 2px; padding: 11px 11px 10px; border-radius: 16px; background: var(--g-soft); border: 1px solid var(--g-line); color: var(--g-ink); text-decoration: none; }
.guide-tile:hover { color: var(--g-ink); }
.guide-tile ion-icon { font-size: 24px; color: var(--g-accent); }
.guide-tile b { font-size: 16px; }
.guide-tile small { font-size: 13px; line-height: 1.5; color: var(--g-muted); }
.guide-tile small b { font-size: inherit; color: var(--g-ink); }

/* ปุ่มใหญ่ */
.guide-cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin: 10px 0 2px; padding: 10px 16px; border-radius: 16px; background: var(--g-hero); color: #fff; font-size: 17px; font-weight: 800; text-decoration: none; box-shadow: 0 12px 24px -14px rgba(0, 0, 0, .55); }
html[data-theme="black"] .guide-cta { color: #f5c542; }
.guide-cta ion-icon { font-size: 21px; }
.guide-cta:hover, .guide-cta:focus { color: #fff; }
html[data-theme="black"] .guide-cta:hover, html[data-theme="black"] .guide-cta:focus { color: #f5c542; }
.guide-cta-small { min-height: 48px; font-size: 15.5px; }

/* ---------- ซื้อหวย: ภาพหน้าจอจำลอง (HTML ล้วน ตัวหนังสือคมทุกจอ) ปัดแนวนอน ---------- */
.gm-steps { list-style: none; margin: 4px -14px 2px; padding: 4px 14px 12px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 80%); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
@media (min-width: 720px) { .gm-steps { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; margin: 4px 0 2px; padding: 4px 0 6px; } .gm-swipe { display: none; } }
.gm-step { scroll-snap-align: center; display: flex; flex-direction: column; gap: 10px; background: var(--g-soft); border: 1px solid var(--g-line); border-radius: 18px; padding: 12px; }
.gm-swipe { font-weight: 800; color: var(--g-accent); }
.gm-text { display: flex; gap: 10px; align-items: flex-start; }
.gm-text > div > b { display: block; font-size: 15.5px; line-height: 1.4; }
.gm-text p { font-size: 13.5px !important; line-height: 1.55 !important; color: var(--g-muted); margin: 3px 0 0 !important; }
.gm-text p b { display: inline; font-size: inherit; color: var(--g-ink); }
.gb-num { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--g-hero); color: #fff; font-size: 15px; font-weight: 900; }
html[data-theme="black"] .gb-num { color: #f5c542; }
.gm-phone { width: 100%; max-width: 240px; margin: 0 auto; border: 7px solid var(--g-phone); border-radius: 24px; background: #fffaf2; overflow: hidden; box-shadow: 0 12px 22px -16px #000; }
.gm-bar { background: var(--g-hero); color: #fff; font-size: 12.5px; font-weight: 800; text-align: center; padding: 6px 8px; }
html[data-theme="black"] .gm-bar { color: #f5c542; }
.gm-screen { display: flex; flex-direction: column; gap: 7px; padding: 9px; min-height: 196px; font-size: 12.5px; line-height: 1.4; color: #3f3420; }
.gm-lotto { display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid #eadfca; border-left: 4px solid #22c55e; border-radius: 11px; padding: 6px 8px; }
.gm-lotto > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.gm-flag { font-style: normal; font-size: 20px; line-height: 1; }
.gm-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.gm-lotto b { font-size: 13.5px; }
.gm-lotto small { font-size: 11px; color: #7a6b52; }
.gm-cd { font-size: 10.5px; font-weight: 900; color: #15803d; background: #ecfdf3; border: 1px solid #bbf7d0; border-radius: 999px; padding: 0 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gm-cd-wait { color: #c2410c; background: #fff1e6; border-color: #fed7aa; }
.gm-buy { font-size: 11px; font-weight: 900; color: #fff; background: #16a34a; border-radius: 8px; padding: 2px 8px; }
.gm-dim { opacity: .55; }
.gm-lotto.gm-dim { border-left-color: #b8b2a6; }
.gm-btn { display: block; text-align: center; border-radius: 11px; padding: 8px 6px; font-size: 13px; font-weight: 900; color: #fff; background: var(--g-hero); }
html[data-theme="black"] .gm-btn { color: #f5c542; }
.gm-btn.gm-ok { background: #15803d; color: #fff; }
.gm-pulse { animation: gmPulse 1.8s ease-in-out infinite; }
@keyframes gmPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); } 50% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } }
.gm-digits { display: flex; justify-content: center; align-items: center; gap: 6px; }
.gm-digits span { width: 34px; height: 40px; border-radius: 9px; background: #fff; border: 2px solid var(--g-accent2); display: grid; place-items: center; font-size: 21px; font-weight: 900; color: #4a3500; }
.gm-digits em { font-style: normal; font-size: 10.5px; font-weight: 800; color: var(--g-deep); background: #fff; border: 1px solid var(--g-line); border-radius: 8px; padding: 3px 5px; }
.gm-hint { background: #eef7f0; color: #1f6b3a; border-radius: 8px; padding: 4px 6px; font-size: 11.5px; font-weight: 800; text-align: center; }
.gm-also { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.gm-also small { font-size: 11px; color: #7a6b52; font-weight: 700; }
.gm-also span { font-size: 11px; font-weight: 800; border: 1px solid #eadfca; background: #fff; border-radius: 999px; padding: 1px 7px; }
.gm-also span.on { background: var(--g-accent); border-color: var(--g-accent); color: #fff; }
.gm-amts { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.gm-amts span { border: 1.5px solid var(--g-line); background: #fff; border-radius: 8px; padding: 3px 7px; font-size: 11.5px; color: #7a6b52; }
.gm-amts i, .gm-amt i { font-style: normal; font-weight: 900; font-size: 13.5px; color: #3f3420; float: right; }
.gm-poy { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; background: #fff; border: 1px solid #eadfca; border-radius: 10px; padding: 6px 8px; }
.gm-poy b { font-size: 16px; letter-spacing: 1px; }
.gm-poy span { font-size: 11.5px; color: #7a6b52; }
.gm-amt { border: 1.5px solid var(--g-line); border-radius: 8px; padding: 1px 6px; color: #3f3420 !important; font-weight: 700; min-width: 64px; }
.gm-split { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: center; }
.gm-clear { font-size: 11.5px; font-weight: 800; color: #b91c1c; border: 1px solid #fecaca; background: #fff; border-radius: 10px; padding: 7px 7px; }
.gm-sum { display: flex; justify-content: space-between; padding: 3px 2px; font-size: 13px; }
.gm-total b { font-size: 18px; color: #1f6b3a; }
.gm-item { background: #fff; border: 1px solid #eee3cf; border-radius: 8px; padding: 5px 7px; font-size: 11.5px; color: #5f5340; }
.gm-item b { color: #1f6b3a; }

/* ส่วนลด (เฉพาะร้านที่เปิด) + รายการสั้น */
.guide-rules-box { margin-top: 10px; background: var(--g-soft); border: 1px solid var(--g-line); border-radius: 16px; padding: 12px; }
.guide-rules-box h3 { display: flex; align-items: center; gap: 8px; color: var(--g-deep); }
.guide-rules-box h3 ion-icon { font-size: 22px; }
.guide-rulelist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.guide-rulelist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.6; color: var(--g-muted); }
.guide-rulelist b { color: var(--g-ink); }
.rl-tag { flex-shrink: 0; min-width: 44px; text-align: center; padding: 2px 6px; border-radius: 9px; font-size: 13px; font-weight: 900; color: #fff; margin-top: 2px; }
.rl-up { background: #059669; } .rl-down { background: #dc2626; } .rl-stop { background: #6b7280; } .rl-day { background: #d97706; }

/* ---------- สิทธิประโยชน์ + อัตราจริง (mango-guide.js) ---------- */
.guide-live .guide-rulelist { margin-bottom: 4px; }
.guide-tier-now { background: var(--g-ok-soft); border: 1px solid #bbf7d0; border-radius: 12px; padding: 9px 12px; font-weight: 800; color: var(--g-ok); }
.guide-ladder { display: grid; gap: 8px; margin: 8px 0 10px; }
.guide-level { background: #fff; border: 1px solid var(--g-line); border-radius: 14px; padding: 10px 12px; }
.guide-level.is-current { border-color: var(--g-ok); box-shadow: 0 0 0 3px #cfe9d7; }
.guide-level strong { display: block; font-size: 16.5px; color: var(--g-ok); margin-bottom: 2px; }
.guide-level p { font-size: 14.5px; margin: 2px 0 0; color: var(--g-ink); }
.guide-level p.gl-unlock { color: var(--g-muted); font-size: 13.5px; }
.guide-stairs { display: flex; align-items: flex-end; gap: 5px; margin: 10px 0 4px; padding-top: 40px; }
.gs-step { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; gap: 1px; padding: 8px 3px; border: 2px solid var(--g-line); border-bottom: 0; border-radius: 12px 12px 0 0; background: linear-gradient(180deg, #fff, var(--g-soft)); }
.gs-lv1 { min-height: 76px; } .gs-lv2 { min-height: 96px; } .gs-lv3 { min-height: 116px; } .gs-lv4 { min-height: 136px; } .gs-lv5 { min-height: 156px; } .gs-lv6 { min-height: 176px; }
.gs-step.is-current { background: var(--g-hero); border-color: var(--g-accent); }
.gs-step.is-current .gs-name, .gs-step.is-current .gs-rate, .gs-step.is-current .gs-unlock { color: #fff; }
.gs-step.is-next { border-style: dashed; }
.gs-name { font-size: 13.5px; font-weight: 900; line-height: 1.3; color: var(--g-ink); overflow-wrap: anywhere; }
.gs-rate { font-size: 12px; font-weight: 700; color: var(--g-muted); line-height: 1.35; }
.gs-unlock { font-size: 11px; color: var(--g-muted); line-height: 1.35; }
.gs-you { position: absolute; top: -36px; left: 50%; transform: translateX(-50%); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; background: var(--g-accent); color: #fff; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; }
.gs-you::after { content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--g-accent); border-bottom: 0; }
.gs-you ion-icon { font-size: 15px; }
.guide-live .guide-stairs-cap { font-size: 13px; color: var(--g-muted); margin: 6px 0 8px; }
@media (max-width: 380px) { .gs-unlock { display: none; } }
.guide-progress { background: #fff; border: 1px solid #cfe3d6; border-radius: 12px; padding: 10px 12px; margin: 8px 0 10px; }
.guide-progress p { margin: 0; font-size: 14.5px; }
.gpr-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; font-size: 14.5px; color: var(--g-ok); }
.gpr-bar { height: 12px; border-radius: 6px; background: #e6efe9; overflow: hidden; margin: 6px 0; }
.gpr-bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #34d399, #059669); min-width: 6px; transition: width .6s ease; }
.gpr-need { color: var(--g-ink); }
.gpr-need b { color: var(--g-accent); }

/* ---------- ถาม-ตอบ ---------- */
.guide-faq details { border-top: 1px solid var(--g-line); }
.guide-faq details:first-child { border-top: 0; }
.guide-faq summary { cursor: pointer; font-size: 15.5px; font-weight: 800; line-height: 1.5; padding: 10px 34px 10px 0; list-style: none; position: relative; }
.guide-faq summary::-webkit-details-marker { display: none; }
.guide-faq summary::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--g-soft); color: var(--g-accent); font-size: 19px; font-weight: 900; }
.guide-faq details[open] summary::after { content: '−'; }
.guide-faq p { margin: 0 0 10px; font-size: 14.5px; color: var(--g-muted); }
.guide-page .guide-footnote { font-size: 13px; color: var(--g-muted); margin: 8px 0 0; }

.guide-end { margin-top: 12px; padding: 14px; border-radius: 20px; background: var(--g-card); border: 1px solid var(--g-line); text-align: center; }
.guide-end p { font-size: 18px; font-weight: 900; margin: 0; }

/* หยุดภาพเคลื่อนไหว */
.guide-page.is-paused .gm-pulse { animation: none; }
@media (prefers-reduced-motion: reduce) { .gm-pulse { animation: none; } }
@media (max-width: 360px) { .guide-quick li { font-size: 12.5px; } .guide-pair { grid-template-columns: 1fr; } }
