/* ===== Template: Social Boost =====
   เปลี่ยนสีทั้งเว็บ: แก้ --brand / --brand-2 (สีไล่เฉดของปุ่มและหัวข้อ)
*/
/* emoji (service names from the boost panel are full of them): the system's colour emoji font, only for emoji
   code points, put first so symbols such as ⚠ ❤ ♻ that the text font would draw in black and white come out in colour
   (★ ☆ ✓ stay with the text font) */
@font-face {
  font-family: 'Emoji';
  src: local('Segoe UI Emoji'), local('Apple Color Emoji'), local('Noto Color Emoji');
  unicode-range: U+203C, U+2049, U+20E3, U+2139, U+2194-2199, U+21A9-21AA, U+231A-231B, U+2328, U+23CF, U+23E9-23F3, U+23F8-23FA, U+24C2, U+25AA-25AB, U+25B6, U+25C0, U+25FB-25FE, U+2600-2604, U+2607-2712, U+2714-27BF, U+2934-2935, U+2B05-2B07, U+2B1B-2B1C, U+2B50, U+2B55, U+3030, U+303D, U+3297, U+3299, U+FE0F, U+1F000-1F1E5, U+1F200-1FAFF;
}
/* country flags 🇹🇭: Windows has none of its own (shows the letters TH), so Twemoji flags (country-flag-emoji-polyfill
   0.1.8, MIT + CC-BY-4.0, see LICENSE-TwemojiCountryFlags.md); downloaded only when a page shows a flag */
@font-face {
  font-family: 'Flags';
  font-display: swap;
  src: url(../fonts/twemoji-country-flags.woff2) format('woff2');
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
}

:root {
  --brand: #7c3aed;
  --brand-2: #ec4899;
  --brand-dark: #5b21b6;
  --brand-soft: #f3edff;
  --accent: #f97316;
  --gradient: linear-gradient(120deg, var(--brand), var(--brand-2));

  --text: #1a1033;
  --muted: #5b5670;
  --line: #e9e5f2;
  --bg: #ffffff;
  --bg-soft: #faf8ff;
  --dark: #150b2e;

  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --danger: #dc2626;
  --danger-soft: #fee2e2;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(76, 29, 149, 0.08);
  --shadow-lg: 0 24px 60px rgba(76, 29, 149, 0.16);
  --font: "Flags", "Emoji", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --container: 1160px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
/* เปลี่ยนหน้าแบบค่อยๆ จาง เหมือนแอป (Chrome / Edge / Safari 18.2+, เบราว์เซอร์อื่นเปลี่ยนหน้าตามปกติ) */
@view-transition { navigation: auto; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.7; font-size: 16px; overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--dark); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .2s, box-shadow .2s, background-color .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 20px rgba(124, 58, 237, .28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(124, 58, 237, .36); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-light { background: #fff; color: var(--brand-dark); }
.btn-light:hover { transform: translateY(-2px); }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn-sm { padding: 8px 16px; font-size: .92rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------- เมนูด้านบน ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: box-shadow .2s; }
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--line), 0 8px 24px rgba(21, 11, 46, .06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand-accent { color: var(--brand-2); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav-list { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-list a { color: var(--muted); text-decoration: none; font-weight: 500; position: relative; padding: 6px 0; }
.nav-list a:hover, .nav-list a.is-active { color: var(--brand); }
.nav-list a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--gradient); }
.nav-actions { display: flex; gap: 10px; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.nav-toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- section ทั่วไป ---------- */
.section { padding: 96px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.eyebrow { display: inline-block; font-weight: 600; font-size: .9rem; color: var(--brand); background: var(--brand-soft); padding: 4px 14px; border-radius: 999px; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 88px; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto auto; width: 720px; height: 720px; border-radius: 50%; background: radial-gradient(circle, rgba(236, 72, 153, .16), transparent 65%); pointer-events: none; }
.hero::after { content: ""; position: absolute; left: -200px; bottom: -260px; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(124, 58, 237, .14), transparent 65%); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); padding: 6px 14px 6px 8px; border-radius: 999px; font-size: .92rem; color: var(--muted); box-shadow: var(--shadow); margin-bottom: 20px; }
.hero-badge b { background: var(--gradient); color: #fff; padding: 2px 10px; border-radius: 999px; font-size: .8rem; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -.01em; }
.hero-lead { font-size: 1.15rem; color: var(--muted); max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: .95rem; }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points svg { width: 18px; height: 18px; color: var(--success); flex: none; }
.hero-visual { position: relative; }
.hero-visual img { width: 100%; height: auto; filter: drop-shadow(0 30px 50px rgba(76, 29, 149, .18)); }

/* ---------- แพลตฟอร์ม ---------- */
.platforms { padding: 28px 0; border-block: 1px solid var(--line); }
.platforms-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 14px; }
.platforms-label { color: var(--muted); font-size: .95rem; margin-right: 8px; }
.platform-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); font-weight: 600; font-size: .95rem; }
.platform-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--brand)); }

/* ---------- การ์ด ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s, border-color .25s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.card h3 { font-size: 1.2rem; }
.card p { color: var(--muted); margin: 0; }
.card-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 18px; }
.card-icon svg { width: 26px; height: 26px; }
.card-icon.is-pink { background: #fde7f3; color: var(--brand-2); }
.card-icon.is-orange { background: #ffedd5; color: var(--accent); }

/* ---------- ตารางราคา ---------- */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 32px; }
.tab { border: 1px solid var(--line); background: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--muted); transition: background-color .2s, color .2s, border-color .2s; }
.tab:hover { color: var(--brand); border-color: var(--brand); }
.tab[aria-selected="true"] { background: var(--gradient); color: #fff; border-color: transparent; }
.no-js .tabs { display: none; }
.price-panel + .price-panel { margin-top: 40px; }
.js .price-panel + .price-panel { margin-top: 0; }
.price-panel-title { font-size: 1.15rem; margin-bottom: 16px; }
.js .price-panel-title { display: none; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.price-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.price-card.is-popular { border: 2px solid transparent; background: linear-gradient(#fff, #fff) padding-box, var(--gradient) border-box; }
.price-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--gradient); color: #fff; font-size: .8rem; font-weight: 600; padding: 3px 14px; border-radius: 999px; white-space: nowrap; }
.price-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.price-card .price { font-size: 2.2rem; font-weight: 700; line-height: 1.2; margin: 10px 0 2px; }
.price-card .price small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.price-unit { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.price-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; color: var(--muted); font-size: .95rem; }
.price-list li { display: flex; gap: 10px; }
.price-list li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; background: var(--success-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat; }
.price-card .btn { margin-top: auto; }
.price-note { text-align: center; color: var(--muted); font-size: .92rem; margin-top: 28px; }
.price-card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.price-card-note { margin: 4px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.price-card .price small:first-child { font-size: .9rem; }
.price-more { text-align: center; margin-top: 24px; }

/* ---------- ขั้นตอน ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step { position: relative; text-align: center; padding: 8px 12px; }
.step-num { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 20px; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; color: #fff; background: var(--gradient); box-shadow: 0 10px 24px rgba(124, 58, 237, .28); }
.step:not(:last-child)::after { content: ""; position: absolute; top: 40px; left: calc(50% + 48px); right: calc(-50% + 48px); border-top: 2px dashed color-mix(in srgb, var(--brand) 35%, transparent); }
.step h3 { font-size: 1.1rem; }
.step p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ---------- ตัวเลข ---------- */
.stats-band { background: var(--dark); color: #fff; padding: 64px 0; position: relative; overflow: hidden; }
.stats-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 15% 0%, rgba(124, 58, 237, .45), transparent 70%), radial-gradient(600px 300px at 85% 100%, rgba(236, 72, 153, .35), transparent 70%); }
.stats-grid { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat-num { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.2; }
.stat-label { color: rgba(255, 255, 255, .72); }

/* ---------- รีวิว ---------- */
.review { display: flex; flex-direction: column; gap: 16px; }
.review-stars { color: #f59e0b; letter-spacing: 2px; }
.review blockquote { margin: 0; color: var(--text); }
.review-author { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.avatar { text-decoration: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--gradient); flex: none; }
.review-author b { display: block; line-height: 1.3; }
.review-author span { color: var(--muted); font-size: .9rem; }
/* รีวิวจริงจาก API (main.js) */
.review-summary { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 16px; margin: -16px 0 32px; color: var(--muted); }
.review-summary b { color: var(--text); font-size: 1.15rem; }
.review-summary .review-stars { font-size: 1.1rem; }
.review blockquote { white-space: pre-line; overflow-wrap: anywhere; }
.review-more { text-align: center; margin-top: 28px; }
.review-empty { text-align: center; color: var(--muted); }
/* ให้คะแนนในหน้าบัญชี: เรียงกลับด้าน ดาวที่เลือกและดาวทางซ้ายเป็นสีเหลือง */
.review-panel { margin-top: 24px; }
.star-field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; margin-top: 6px; }
.field .star-input input { position: absolute; width: 1px; height: 1px; opacity: 0; padding: 0; margin: 0; border: 0; }
.star-input label { font-size: 2rem; line-height: 1; color: var(--line); cursor: pointer; transition: color .15s, transform .15s; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f59e0b; }
.star-input input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.star-input label:active { transform: scale(.85); }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- คำถาม ---------- */
.faq { max-width: 800px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 22px; transition: border-color .2s; }
.faq details[open] { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 32px 18px 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 400; color: var(--brand); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 18px; margin: 0; }

/* ---------- CTA ---------- */
.cta { padding: 0 0 96px; }
.cta-box { border-radius: 28px; padding: 56px; background: var(--gradient); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.cta-box::after { content: ""; position: absolute; right: -80px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.cta-box h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 8px; }
.cta-box p { margin: 0; opacity: .9; }
.cta-box .btn { position: relative; z-index: 1; }

/* ---------- footer ---------- */
.site-footer { background: var(--dark); color: rgba(255, 255, 255, .75); padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: rgba(255, 255, 255, .75); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 48px; padding-top: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- หน้านโยบาย / เงื่อนไข (privacy.html, terms.html) ---------- */
.container.legal { max-width: 760px; padding-top: 56px; padding-bottom: 80px; }
.legal h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 6px; }
.legal-updated { color: var(--muted); font-size: .92rem; margin: 0 0 28px; }
.legal-summary { background: var(--brand-soft); border-radius: var(--radius-sm); padding: 18px 22px; margin-bottom: 36px; }
.legal-summary p { margin: 0; }
.legal h2 { font-size: 1.2rem; margin: 36px 0 10px; scroll-margin-top: calc(var(--header-h) + 16px); }
.legal p, .legal li { color: #3d3654; line-height: 1.75; }
.legal ul, .legal ol { padding-left: 1.3em; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--brand); }
.legal-toc { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 22px; margin-bottom: 8px; }
.legal-toc ol { margin: 8px 0 0; columns: 2 220px; column-gap: 32px; }
.legal-toc li { margin: 0 0 6px; break-inside: avoid; }

/* ---------- เอฟเฟกต์ตอนเลื่อน (ซ่อนเฉพาะเมื่อมี JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ===================================================================
   หน้าสมาชิก (login / register / dashboard)
   =================================================================== */
.demo-banner { background: var(--warning-soft); color: var(--warning); text-align: center; font-size: .9rem; padding: 8px 16px; }
.demo-banner b { font-weight: 700; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--gradient); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.auth-side .brand { color: #fff; }
.auth-side .brand-accent { color: #fff; opacity: .8; }
.auth-side h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); max-width: 420px; }
.auth-side ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.auth-side li { display: flex; gap: 10px; align-items: center; }
.auth-side li svg { width: 20px; height: 20px; flex: none; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-card h1 { font-size: 1.8rem; margin-bottom: 6px; }
.auth-card > p { color: var(--muted); margin-bottom: 28px; }
.auth-switch { text-align: center; margin-top: 24px; color: var(--muted); }
.auth-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; margin-bottom: 32px; font-size: .95rem; }
.auth-back:hover { color: var(--brand); }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); }

/* Dropdowns: our own arrow in every browser. Chrome / Edge 135+ also draw the open list in the site's style
   (appearance: base-select); other browsers keep their own list, which is the better one on phones anyway. */
.field select {
  appearance: none; padding-right: 44px; cursor: pointer; text-overflow: ellipsis;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
.field select:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.field select option { color: var(--text); background: #fff; }
@supports (appearance: base-select) {
  .field select, .field select::picker(select) { appearance: base-select; }
  .field select { display: block; padding-right: 14px; background-image: none; }
  .field select::picker-icon { display: none; }
  /* the button dashboard.js puts first: a long service name ends with "…" before the arrow */
  .field select > button { all: unset; display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; cursor: pointer; }
  .field select > button selectedcontent { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .field select > button::after {
    content: ""; flex: none; width: 18px; height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat center / 18px; transition: rotate .2s;
  }
  .field select:open { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); }
  .field select:open > button::after { rotate: 180deg; }
  .field select::picker(select) {
    margin-block: 8px; padding: 6px; max-height: min(360px, 55vh); max-width: min(480px, calc(100vw - 32px)); overflow-y: auto;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-lg);
    opacity: 1; translate: 0 0;
    transition: opacity .16s, translate .16s, display .16s allow-discrete, overlay .16s allow-discrete;
  }
  @starting-style { .field select:open::picker(select) { opacity: 0; translate: 0 -6px; } }
  .field select:not(:open)::picker(select) { opacity: 0; translate: 0 -6px; }
  .field select option {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
    line-height: 1.5; white-space: normal; cursor: pointer; transition: background-color .15s, color .15s;
  }
  .field select option:hover, .field select option:focus-visible { outline: none; background: var(--brand-soft); color: var(--brand-dark); }
  .field select option:checked { font-weight: 600; color: var(--brand-dark); }
  .field select option::checkmark { order: 1; margin-left: auto; content: "✓"; color: var(--brand); font-weight: 700; }
  .field select option:disabled { opacity: .5; cursor: default; }
}
.field-hint { color: var(--muted); font-size: .85rem; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 76px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--brand); font-weight: 600; font-size: .88rem; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--muted); margin-bottom: 20px; }
.check input { margin-top: 5px; accent-color: var(--brand); }
.check a { color: var(--brand); }

.alert { border-radius: var(--radius-sm); padding: 12px 14px; font-size: .95rem; margin-bottom: 16px; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-info { background: var(--info-soft); color: var(--info); }
.muted { color: var(--muted); font-weight: 400; }

/* หน้าข้อมูลส่วนตัว */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
.profile-grid { grid-template-columns: 1fr 1fr; }
.field-label { font-weight: 600; font-size: .95rem; }
.profile-email { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.profile-email b { overflow-wrap: anywhere; }
.profile-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.profile-facts div { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.profile-facts dt { color: var(--muted); font-size: .85rem; }
.profile-facts dd { margin: 0; font-weight: 600; }
.profile-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.profile-actions h3, .danger-zone h3 { font-size: 1rem; margin: 0 0 4px; }
.profile-actions p { margin: 0; }
.danger-zone { margin-top: 8px; padding: 18px; border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); border-radius: var(--radius-sm); }
.danger-zone form { max-width: 420px; margin-top: 12px; }
.dash-title .auth-back { display: inline-block; margin-bottom: 6px; }

/* แดชบอร์ด */
.dash-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.dash-header .header-inner { height: 64px; }
.dash-user { display: flex; align-items: center; gap: 12px; }
.dash-user .avatar { width: 38px; height: 38px; font-size: .95rem; }
.dash-user-name { font-weight: 600; line-height: 1.2; }
.dash-user-email { color: var(--muted); font-size: .82rem; }
.dash-main { padding: 32px 0 72px; background: var(--bg-soft); min-height: calc(100vh - 64px); }
.dash-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.dash-title h1 { font-size: 1.6rem; margin: 0; }
.dash-title p { margin: 0; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.tile-label { color: var(--muted); font-size: .9rem; }
.tile-value { font-size: 1.7rem; font-weight: 700; line-height: 1.3; }
.tile.is-balance { background: var(--gradient); color: #fff; border: 0; }
.tile.is-balance .tile-label { color: rgba(255, 255, 255, .85); }
.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; margin-bottom: 24px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel h2 { font-size: 1.2rem; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; }
.order-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--bg-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; }
.order-summary b { font-size: 1.4rem; }
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.amount { border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); padding: 10px; font-weight: 600; cursor: pointer; transition: border-color .2s, background-color .2s, color .2s; }
.amount:hover { border-color: var(--brand); }
.amount.is-selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .85rem; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.link-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.badge-waiting { background: var(--warning-soft); color: var(--warning); }
.badge-pending { background: var(--warning-soft); color: var(--warning); }
.badge-processing { background: var(--info-soft); color: var(--info); }
.badge-completed { background: var(--success-soft); color: var(--success); }
.badge-canceled { background: var(--danger-soft); color: var(--danger); }
.badge-partial { background: var(--warning-soft); color: var(--warning); }
.badge-failed { background: var(--danger-soft); color: var(--danger); }
.cell-note { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.link-btn { display: inline-block; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--danger); font: inherit; font-size: .82rem; font-weight: 600; text-decoration: underline; cursor: pointer; }
.link-btn.is-brand { color: var(--brand); margin: 0 0 0 4px; }
.link-btn.is-confirm { padding: 2px 8px; border-radius: 999px; background: var(--danger-soft); text-decoration: none; }
.link-btn:disabled { opacity: .5; cursor: progress; }
/* เติมเงินด้วย QR (โหมดใช้งานจริง) */
.topup-pay { text-align: center; }
.topup-pay-amount { margin: 0 0 12px; }
.topup-pay-amount b { font-size: 1.5rem; }
.topup-qr { display: block; width: 240px; max-width: 100%; height: auto; margin: 0 auto 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.topup-steps { margin: 12px 0 16px; padding-left: 20px; text-align: left; color: var(--muted); font-size: .9rem; }
.topup-pay form { text-align: left; }
.topup-pay [data-pay-close] { margin-top: 8px; }
.topup-history { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.topup-history h3 { font-size: 1rem; margin: 0 0 10px; }
.topup-history ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.topup-history li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .9rem; }
.topup-history li button { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; }

/* ===================================================================
   หลังร้าน (admin.html)
   =================================================================== */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.is-up { color: var(--success); }
.is-down { color: var(--danger); }
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 20px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { flex: none; border: 0; background: none; padding: 9px 18px; border-radius: 999px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background-color .2s, color .2s; }
.admin-tab:hover { color: var(--brand); }
.admin-tab[aria-selected="true"] { background: var(--gradient); color: #fff; }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.admin-toolbar .field { margin: 0; }
.admin-search { flex: 1 1 260px; }
.admin-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-chip { border: 1px solid var(--line); background: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.admin-chip:hover { border-color: var(--brand); color: var(--brand); }
.admin-chip.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.tab-count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; line-height: 20px; text-align: center; vertical-align: 1px; }
.dash-icon-btn { position: relative; }
.dash-icon-dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px #fff; }
.review-cell .review-stars { font-size: .95rem; }
.review-text { display: block; margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; max-width: 480px; }
.admin-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.admin-pager:empty { display: none; }
.admin-gap { margin-bottom: 24px; }
.admin-actions { white-space: nowrap; }
.admin-actions .btn + .btn { margin-left: 6px; }
.admin-logout svg { display: none; width: 18px; height: 18px; }
.admin-price-input { width: 110px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; }
.admin-price-input:focus { outline: none; border-color: var(--brand); }
.admin-prices input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.admin-bars { display: flex; align-items: flex-end; gap: 6px; height: 200px; list-style: none; margin: 0; padding: 0 0 22px; overflow-x: auto; }
.admin-bars li { flex: 1 0 18px; max-width: 48px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.admin-bar { width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--gradient); }
.admin-bars small { position: absolute; bottom: -20px; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.admin-table-details { margin-top: 12px; }
.admin-table-details summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9rem; }
.admin-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 0; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-lg); }
.admin-dialog::backdrop { background: rgba(21, 11, 46, .45); }
.admin-confirm { width: min(420px, calc(100vw - 32px)); }
.admin-confirm.is-fallback { display: block; position: fixed; z-index: 100; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; box-shadow: 0 0 0 100vmax rgba(21, 11, 46, .45), var(--shadow-lg); }
.admin-confirm h2 { font-size: 1.15rem; }
.admin-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.admin-subtitle { font-size: 1rem; margin: 20px 0 8px; }
.admin-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.admin-history li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.admin-history li:last-child { border-bottom: 0; }
.admin-settings { grid-template-columns: 1.4fr 1fr; }
.cell-stack { min-width: 0; overflow-wrap: anywhere; }
.cell-stack .badge + .cell-note { margin-top: 4px; }

/* ===================================================================
   มือถือแบบแอป: เมนูด้านล่าง (.app-nav และแท็บหลังร้าน) แสดงเมื่อจอ ≤ 640px
   =================================================================== */
.app-nav, .tab-icon, .label-short, .tile-action, .show-mobile { display: none; }

/* ===================================================================
   จอเล็ก
   =================================================================== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .admin-settings { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 16px;
    background: #fff; padding: 16px 24px 24px; border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px rgba(21, 11, 46, .08);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-list a.is-active::after { display: none; }
  .nav-actions .btn { flex: 1; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 480px; margin: 0 auto; }
  .grid-3, .price-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .step::after { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .cta-box { flex-direction: column; text-align: center; padding: 44px 28px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

@media (max-width: 720px) {
  /* ตารางคำสั่งซื้อเป็นการ์ด */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 14px; margin-bottom: 12px; }
  .table td { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; text-align: left; flex: none; }
  .table tr td:last-child { border-bottom: 0; }
  .table td.empty { justify-content: center; text-align: center; }
  .table .num { text-align: right; }
  .link-cell { max-width: none; min-width: 0; }
  .link-cell a { overflow: hidden; text-overflow: ellipsis; }
  .table td > .cell-stack { flex: 1; min-width: 0; text-align: right; }
  .table td.admin-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .table td.admin-actions::before { margin-right: auto; }
  .table td.admin-actions .btn + .btn { margin-left: 0; }
  .table td > .cell-stack .cell-note a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 36px; }
  .hero { padding: 40px 0 64px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .grid-3, .price-grid { grid-template-columns: 1fr; }
  .price-grid { gap: 28px; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .card, .price-card { padding: 22px; }
  .cta { padding-bottom: 64px; }
  .cta-box { border-radius: 22px; padding: 36px 20px; }
  .cta-box .btn { width: 100%; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .tiles { gap: 10px; }
  .tile { padding: 14px; }
  .tile-value { font-size: 1.3rem; }
  .panel { padding: 18px; }
  .dash-user-text { display: none; }
  .dash-user { gap: 8px; flex: none; }
  .dash-user .btn-sm { padding: 7px 12px; font-size: .85rem; }
  .profile-facts { grid-template-columns: 1fr; }
  .admin-actions { white-space: normal; }
  .admin-dialog { padding: 18px; }
  .profile-actions { flex-direction: column; align-items: stretch; }
  .amounts { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- มือถือแบบแอป ---------- */
@media (max-width: 640px) {
  html { -webkit-tap-highlight-color: transparent; }
  body.has-app-nav { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .hide-mobile { display: none !important; }

  /* แถบบน: เตี้ยลง เลี่ยงรอยบากของจอ ชื่อยาวตัดด้วย … */
  .site-header, .dash-header { padding-top: env(safe-area-inset-top); }
  .site-header { --header-h: 60px; }
  .site-header .header-inner { height: 60px; }
  .site-header .nav, .site-header .nav-toggle { display: none; }
  .dash-header { background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .dash-header .header-inner { height: 56px; }
  .brand { min-width: 0; font-size: 1.08rem; }
  .brand img { width: 32px; height: 32px; flex: none; }
  .dash-header .brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .site-footer { padding-bottom: 24px; }

  /* เมนูด้านล่าง */
  .app-nav, .admin-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: 0 -6px 24px rgba(21, 11, 46, .06);
    overflow: visible;
  }
  .app-nav a, .admin-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0;
    padding: 2px 0; min-height: 52px; border-radius: 14px; background: none;
    color: var(--muted); font-size: .72rem; font-weight: 600; line-height: 1.25; text-decoration: none; text-align: center;
    -webkit-user-select: none; user-select: none; transition: color .2s, transform .12s;
  }
  .app-nav a > span, .admin-tab > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-nav svg, .admin-tab .tab-icon {
    display: block; width: 52px; height: 30px; padding: 4px 14px; border-radius: 999px; flex: none;
    transition: background-color .2s, color .2s;
  }
  .app-nav a.is-active, .admin-tab[aria-selected="true"] { color: var(--brand-dark); background: none; }
  .app-nav a.is-active svg, .admin-tab[aria-selected="true"] .tab-icon { background: var(--brand-soft); color: var(--brand); }

  /* หลังร้าน: ภาพรวม = ปุ่มกลาง ซ้าย คำสั่งงาน / สมาชิก ขวา เติมเงิน / ราคา ตั้งค่าย้ายไปปุ่มเฟืองบนแถบบน */
  .admin-tab[data-tab="orders"] { order: 1; }
  .admin-tab[data-tab="members"] { order: 2; }
  .admin-tab-home { order: 3; }
  .admin-tab[data-tab="topups"] { order: 4; }
  .admin-tab[data-tab="prices"] { order: 5; }
  .admin-tab[data-tab="settings"], .admin-tab[data-tab="reviews"] { display: none; } /* ปุ่มรีวิว / ตั้งค่าอยู่แถบบน */
  .dash-icon-btn.show-mobile {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
    border: 0; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); cursor: pointer;
  }
  .dash-icon-btn svg { width: 20px; height: 20px; }
  .dash-user > span.avatar { display: none; } /* หลังร้าน: ซ่อนวงชื่อย่อ เหลือที่ให้ชื่อร้าน */
  /* ออกจากระบบเหลือไอคอน (ชื่ออยู่ใน aria-label) */
  .dash-user .admin-logout { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .admin-logout svg { display: block; }
  .admin-logout span { display: none; }
  .dash-icon-btn[aria-pressed="true"] { background: var(--gradient); color: #fff; }
  .dash-icon-btn:active { transform: scale(.9); }

  /* ปุ่มหน้าแรก / ภาพรวมตรงกลาง: วงกลมไล่สี ลอยเหนือแถบ */
  .app-nav a.app-nav-home, .admin-tab.admin-tab-home { justify-content: flex-end; padding-bottom: 5px; color: var(--brand-dark); }
  .app-nav a.app-nav-home svg,
  .app-nav a.app-nav-home.is-active svg,
  .admin-tab.admin-tab-home .tab-icon,
  .admin-tab.admin-tab-home[aria-selected="true"] .tab-icon {
    width: 60px; height: 60px; padding: 16px; margin-top: -30px; border-radius: 50%;
    background: var(--gradient); color: #fff;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, .94), 0 10px 24px rgba(124, 58, 237, .42);
  }

  /* กดแล้วเด้งดึ๋ง (app-nav.js ใส่ .is-boing ตอนแตะ) */
  .app-nav a.is-boing svg, .admin-tab.is-boing .tab-icon, .dash-icon-btn.is-boing svg { animation: app-boing .55s ease-out; }
  .label-long { display: none; }
  .label-short { display: inline; }

  /* หน้าสมาชิก / หลังร้าน: พื้นเทาอ่อน การ์ดไม่มีเส้นขอบ */
  .dash-main { padding: 16px 0 24px; min-height: calc(100vh - 56px); }
  .dash-title { margin-bottom: 16px; }
  .dash-title h1 { font-size: 1.3rem; }
  .dash-title p { font-size: .92rem; }
  .panel, .tile { border: 0; border-radius: 20px; box-shadow: 0 1px 2px rgba(21, 11, 46, .04), 0 8px 24px rgba(76, 29, 149, .06); }
  .panel h2 { font-size: 1.1rem; margin-bottom: 14px; }
  .dash-grid { gap: 16px; margin-bottom: 16px; }
  .tiles { margin-bottom: 16px; }
  .tile.is-balance { box-shadow: 0 12px 28px rgba(124, 58, 237, .3); }

  /* แดชบอร์ด: บัตรยอดเงินเต็มแถว ตัวเลขอีก 3 ช่องเรียงแถวเดียว */
  .tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles-3 .tile.is-balance {
    grid-column: 1 / -1; padding: 16px 18px 18px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label action" "value value"; align-items: center; column-gap: 12px;
  }
  .tiles-3 .tile.is-balance .tile-label { grid-area: label; }
  .tiles-3 .tile.is-balance .tile-value { grid-area: value; font-size: clamp(1.6rem, 9vw, 2rem); overflow-wrap: anywhere; }
  .tiles-3 .tile:not(.is-balance) { text-align: center; padding: 12px 6px; }
  .tiles-3 .tile:not(.is-balance) .tile-label { font-size: .76rem; line-height: 1.35; }
  .tile-action {
    display: inline-flex; grid-area: action;
    padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .22); color: #fff;
    font-weight: 600; font-size: .9rem; text-decoration: none;
  }
  .tile-action:active { background: rgba(255, 255, 255, .34); }
  body[data-mview="topup"] .tile-action { display: none; }
  body[data-mview="order"] [data-in]:not([data-in~="order"]),
  body[data-mview="topup"] [data-in]:not([data-in~="topup"]),
  body[data-mview="orders"] [data-in]:not([data-in~="orders"]) { display: none; }

  /* ตารางเป็นการ์ดบนพื้นขาวของ panel */
  .table tr { background: var(--bg-soft); border: 0; border-radius: 16px; }
  .table td { border-bottom-color: color-mix(in srgb, var(--line) 80%, transparent); }

  /* ช่องกรอกสูงขึ้น กดง่ายด้วยนิ้ว */
  .field input, .field select, .field textarea { padding: 13px 14px; border-radius: 14px; }
  .btn-lg { padding: 14px 24px; }

  /* หน้าเข้าสู่ระบบ / สมัคร: หัวสีไล่เฉดด้านบน แล้วการ์ดฟอร์มซ้อนขึ้นมา */
  .auth-page { min-height: 100vh; align-content: start; background: var(--bg-soft); }
  .auth-side {
    display: flex; gap: 12px; justify-content: flex-start;
    padding: calc(20px + env(safe-area-inset-top)) 20px 56px; border-radius: 0 0 28px 28px;
  }
  .auth-side::after { width: 260px; height: 260px; right: -90px; bottom: -110px; }
  .auth-side h2 { font-size: 1.35rem; margin: 6px 0 0; }
  .auth-side ul, .auth-side small { display: none; }
  .auth-main { justify-content: flex-start; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); margin-top: -32px; position: relative; z-index: 1; }
  .auth-card { background: #fff; border-radius: 24px; padding: 24px 20px; box-shadow: var(--shadow-lg); }
  .auth-card h1 { font-size: 1.45rem; }
  .auth-card > p { margin-bottom: 20px; }
  .auth-back { margin-bottom: 16px; }
}

@media (max-width: 640px) and (hover: none) {
  .btn:active { transform: scale(.97); }
}

@media (hover: none) {
  .btn-primary:hover, .btn-light:hover, .card:hover { transform: none; }
  .card:hover { box-shadow: var(--shadow); border-color: var(--line); }
}

@keyframes app-boing {
  0% { scale: 1; }
  20% { scale: 1.18 .78; }
  40% { scale: .86 1.16; }
  58% { scale: 1.08 .94; }
  76% { scale: .97 1.03; }
  100% { scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
