/* ศูนย์ทดลองระบบสมาชิก Yumat (/demo) — แบรนด์ขาว #FFFFFF เป็นหลัก ดำ #0D0D0D และทอง #D4AF37 เป็นสีเน้น
 * ทองใช้เป็นพื้น/เส้น/ไอคอนคู่กับตัวอักษรดำเท่านั้น (ทองบนขาวคอนทราสต์ต่ำเกินสำหรับตัวอักษร) */
:root {
    --dm-ink: #0D0D0D;
    --dm-gold: #D4AF37;
    --dm-gold-soft: #f7efd6;
    --dm-gold-deep: #8a6d12; /* ทองเข้มสำหรับตัวอักษรบนพื้นขาว (คอนทราสต์ผ่าน) */
    --dm-muted: #5c5f66;
    --dm-line: #ebe7dc;
    --dm-bg: #ffffff;
}

/* ── แถบโหมดทดลอง ───────────────────────────────────────── */
.demo-ribbon { position: sticky; top: 0; z-index: 1040; background: var(--dm-ink); color: #fff; font-family: 'Kanit', system-ui, sans-serif; border-bottom: 2px solid var(--dm-gold); }
.demo-ribbon__inner { max-width: 1200px; margin: 0 auto; padding: 6px 12px; display: flex; align-items: center; gap: 8px; min-height: 48px; }
.demo-ribbon__badge { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; min-width: 0; }
.demo-ribbon__badge:hover { color: var(--dm-gold); }
.demo-ribbon__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dm-gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .3); flex-shrink: 0; }
.demo-ribbon__sub { font-weight: 400; opacity: .85; }
.demo-ribbon__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.demo-ribbon__btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; min-width: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .25);
    background: transparent; color: #fff; font: inherit; font-size: .82rem; text-decoration: none; white-space: nowrap; cursor: pointer; }
.demo-ribbon__btn:hover, .demo-ribbon__btn:focus-visible { border-color: var(--dm-gold); color: var(--dm-gold); }
.demo-ribbon__btn.is-gold { background: var(--dm-gold); border-color: var(--dm-gold); color: var(--dm-ink); font-weight: 600; }
.demo-ribbon__btn.is-gold:hover { background: #e2c35a; color: var(--dm-ink); }
@media (max-width: 575.98px) {
    .demo-ribbon__sub, .demo-ribbon__opt { display: none; }
    .demo-ribbon__btn { padding: 0 8px; }
}
@media (max-width: 379.98px) {
    .demo-ribbon__btn.is-gold span { display: none; }
}

.demo-flash { max-width: 1200px; margin: 10px auto 0; padding: 10px 14px; border-radius: 12px; display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; font-family: 'Kanit', system-ui, sans-serif; }
.demo-flash--ok { background: #ecf8f0; color: #14532d; border: 1px solid #bfe5cc; }
.demo-flash--err { background: #fdeeee; color: #7f1d1d; border: 1px solid #f3c4c4; }
.app-content .demo-flash, .liff-wrap .demo-flash { margin: 0 0 12px; }

/* ── ทัวร์ ──────────────────────────────────────────────── */
.demo-tour { position: fixed; z-index: 1042; /* ใต้หน้าต่าง modal/แผ่นล่าง เพื่อไม่บังปุ่มยืนยัน */ left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(440px, calc(100vw - 24px));
    background: #fff; color: var(--dm-ink); border: 1px solid var(--dm-line); border-top: 4px solid var(--dm-gold); border-radius: 16px; box-shadow: 0 12px 40px rgba(13, 13, 13, .25);
    padding: 12px 14px 12px; font-family: 'Kanit', system-ui, sans-serif; }
.demo-tour[hidden] { display: none; }
@media (max-width: 991.98px) {
    body.has-bottom-nav .demo-tour { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
.demo-tour__head { display: flex; align-items: center; justify-content: space-between; }
.demo-tour__label { font-size: .8rem; font-weight: 600; color: var(--dm-gold-deep); }
.demo-tour__close { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 8px; color: var(--dm-muted); }
.demo-tour__close:hover { background: #f3f3f3; color: var(--dm-ink); }
.demo-tour__chips { display: flex; gap: 6px; margin: 2px 0 6px; }
.demo-tour__chip { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--dm-line); background: #fff; font-weight: 600; font-size: .85rem; color: var(--dm-muted); }
.demo-tour__chip.is-done { background: var(--dm-gold-soft); border-color: var(--dm-gold); color: var(--dm-ink); }
.demo-tour__chip.is-active { background: var(--dm-ink); border-color: var(--dm-ink); color: #fff; }
.demo-tour__title { font-size: 1.02rem; font-weight: 600; margin: 0 0 4px; }
.demo-tour__body { font-size: .9rem; color: #33363b; margin: 0 0 8px; line-height: 1.5; }
.demo-tour__away { font-size: .82rem; color: var(--dm-gold-deep); margin: 0 0 8px; }
.demo-tour__away[hidden], .demo-tour__btn[hidden] { display: none; }
.demo-tour__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.demo-tour__btn { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--dm-line); background: #fff; color: var(--dm-ink); font: inherit; font-size: .9rem;
    display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; }
.demo-tour__btn:disabled { opacity: .45; cursor: default; }
.demo-tour__btn.is-primary { background: var(--dm-ink); border-color: var(--dm-ink); color: #fff; font-weight: 600; }
.demo-tour__btn.is-gold { background: var(--dm-gold); border-color: var(--dm-gold); color: var(--dm-ink); font-weight: 600; }
.demo-tour-target { outline: 3px solid var(--dm-gold) !important; outline-offset: 3px; border-radius: 10px; animation: demo-pulse 1.6s ease-out 3; position: relative; z-index: 2; }
tr.demo-tour-target > td { background: var(--dm-gold-soft) !important; }
@keyframes demo-pulse { 0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, .55); } 100% { box-shadow: 0 0 0 14px rgba(212, 175, 55, 0); } }
@media (prefers-reduced-motion: reduce) { .demo-tour-target { animation: none; } }
body.demo-tour-on .app-content, body.demo-tour-on .liff-wrap { padding-bottom: 240px !important; }

.demo-toast { position: fixed; z-index: 1070; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--dm-ink); color: #fff; padding: 10px 16px; border-radius: 12px;
    font-family: 'Kanit', system-ui, sans-serif; font-size: .9rem; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }

/* ── หน้าศูนย์ทดลอง (hub) ─────────────────────────────────── */
body.demo-public { background: var(--dm-bg); color: var(--dm-ink); font-family: 'Kanit', system-ui, sans-serif; margin: 0; }
.dh-wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.dh-hero { padding: 40px 0 28px; background: radial-gradient(1200px 300px at 50% -80px, var(--dm-gold-soft), transparent 70%); }
.dh-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .3px; margin-bottom: 18px; }
.dh-brand__mark { width: 40px; height: 40px; border-radius: 12px; background: var(--dm-ink); color: var(--dm-gold); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.dh-title { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 700; line-height: 1.15; margin: 0 0 10px; }
.dh-title span { box-shadow: inset 0 -.38em 0 var(--dm-gold-soft); }
.dh-lead { font-size: clamp(1rem, 2.4vw, 1.15rem); color: #36383d; max-width: 720px; margin: 0 0 22px; line-height: 1.6; }
.dh-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 760px; }
@media (min-width: 768px) { .dh-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; } }
.dh-btn { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 76px; padding: 12px 14px; border-radius: 14px; text-decoration: none;
    border: 1.5px solid var(--dm-ink); color: var(--dm-ink); background: #fff; font-weight: 600; line-height: 1.25; transition: transform .15s, box-shadow .15s; }
.dh-btn i { font-size: 1.35rem; }
.dh-btn small { font-weight: 400; color: var(--dm-muted); font-size: .78rem; }
.dh-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(13, 13, 13, .12); color: var(--dm-ink); }
.dh-btn--dark { background: var(--dm-ink); color: #fff; }
.dh-btn--dark small { color: #d6d6d6; }
.dh-btn--dark:hover { color: #fff; }
.dh-btn--dark i { color: var(--dm-gold); }
.dh-btn--gold { background: var(--dm-gold); border-color: var(--dm-gold); }
.dh-btn--gold small { color: #3d3104; }
.dh-note { font-size: .85rem; color: var(--dm-muted); margin-top: 12px; }
.dh-line { margin-top: 10px; }
.dh-section { padding: 28px 0; border-top: 1px solid var(--dm-line); }
.dh-h2 { font-size: 1.35rem; font-weight: 700; margin: 0 0 6px; }
.dh-sub { color: var(--dm-muted); margin: 0 0 16px; }
.dh-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .dh-grid--2 { grid-template-columns: 1fr 1fr; } .dh-grid--4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 480px) and (max-width: 767.98px) { .dh-grid--4 { grid-template-columns: 1fr 1fr; } }
.dh-card { border: 1px solid var(--dm-line); border-radius: 16px; padding: 18px; background: #fff; }
.dh-card__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--dm-gold-soft); color: var(--dm-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 8px; }
.dh-card h3 { font-size: 1.08rem; font-weight: 600; margin: 0 0 6px; }
.dh-card ul { padding-left: 1.1rem; margin: 0 0 12px; color: #33363b; }
.dh-card li { margin-bottom: 3px; }
.dh-link { font-weight: 600; color: var(--dm-ink); text-decoration: none; border-bottom: 2px solid var(--dm-gold); }
.dh-link:hover { color: var(--dm-gold-deep); }
.dh-step__num { width: 32px; height: 32px; border-radius: 50%; background: var(--dm-ink); color: var(--dm-gold); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.dh-feat { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--dm-line); }
.dh-feat:last-child { border-bottom: 0; }
.dh-feat__name { font-weight: 500; }
.dh-feat__desc { font-size: .85rem; color: var(--dm-muted); }
.dh-tag { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.dh-tag--have { background: #ecf8f0; color: #14532d; }
.dh-tag--plan { background: #eef2ff; color: #3730a3; }
.dh-tag--addon { background: var(--dm-gold-soft); color: #5b4708; border: 1px solid #e8d48f; }
.dh-tag--soon { background: #f1f1f1; color: #4b4f56; }
.dh-tag--sim { background: var(--dm-ink); color: var(--dm-gold); }
.dh-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; font-size: .82rem; color: var(--dm-muted); align-items: center; }
.dh-footer { border-top: 1px solid var(--dm-line); padding: 18px 0 28px; color: var(--dm-muted); font-size: .9rem; }
.dh-confirm { max-width: 520px; margin: 40px auto; }

/* ── หลังบ้านร้านตัวอย่าง ─────────────────────────────────── */
.demo-shop .app-sidebar__logo { background: var(--dm-ink); color: var(--dm-gold); }
.demo-shop .demo-sim-note { background: var(--dm-gold-soft); border: 1px solid #e8d48f; color: #4a3a06; border-radius: 12px; padding: 10px 12px; font-size: .88rem; display: flex; gap: 8px; align-items: flex-start; }
.demo-shop .demo-me { display: inline-block; background: var(--dm-ink); color: var(--dm-gold); border-radius: 999px; padding: 1px 8px; font-size: .72rem; font-weight: 600; }
.demo-shop .demo-qr-sample { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border: 1px dashed #c9c2ad; border-radius: 12px; background: #fff; }
.demo-shop .demo-qr-sample img { width: 140px; height: 140px; image-rendering: pixelated; }
.demo-shop .demo-bubble { background: #fff; border-radius: 16px 16px 16px 4px; padding: 10px 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); white-space: pre-wrap; word-break: break-word; max-width: 320px; }
.demo-shop .demo-chat { background: #8cabd9; border-radius: 14px; padding: 14px; }
@media (max-width: 575.98px) {
    .demo-tour { padding: 8px 12px 10px; }
    .demo-tour__title { font-size: .95rem; }
    .demo-tour__body { font-size: .84rem; margin-bottom: 6px; }
    .demo-tour__chip { width: 28px; height: 28px; }
    .demo-tour__btn { min-height: 38px; }
}
