/* ธาตุดี – เว็บไซต์ · ฟอนต์อยู่ในเว็บเอง ไม่มีสคริปต์หรือไฟล์จากที่อื่น (สอดคล้องกับนโยบายไม่ส่งข้อมูลออก)
   รูปแบบเดียวกับเว็บ RabJai: พื้นสว่าง การ์ดขอบบาง แถบบนติดหน้าจอ ใช้สีน้ำเงินกลางคืนกับทองของไอคอนแอป */
@font-face { font-family: 'IBM Plex Sans Thai'; font-weight: 400; font-display: swap; src: url('fonts/IBMPlexSansThai-Regular.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Sans Thai'; font-weight: 500; font-display: swap; src: url('fonts/IBMPlexSansThai-Medium.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Sans Thai'; font-weight: 600; font-display: swap; src: url('fonts/IBMPlexSansThai-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Sans Thai'; font-weight: 700; font-display: swap; src: url('fonts/IBMPlexSansThai-Bold.ttf') format('truetype'); }

:root {
  --bg: #F6F5F1; --surface: #FFFFFF; --fg: #16152B; --muted: #5A5768;
  --line: #E4E1D8; --accent: #2F2C7A; --night: #1C1B3A; --gold: #E3B75A; --gold-deep: #A8761A; --tile: #F3EEFF;
  --wood: #34B36B; --fire: #E2403A; --earth: #E9A92B; --metal: #D9D4C8; --water: #3B7BE0;
  --gold-a: #C98A12; --gold-b: #A8761A;
  --font: 'IBM Plex Sans Thai', 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #111024; --surface: #1A1934; --fg: #ECEAF5; --muted: #A9A5BE;
  --line: #2C2A50; --accent: #E3B75A; --tile: #262451; --metal: #ECE7DD;
  --gold-a: #FDE68A; --gold-b: #E3B75A; color-scheme: dark } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.mute { color: var(--muted); }
.small { font-size: 14px; }

/* chrome: แถบบน ความกว้าง และส่วนท้าย ใช้ร่วมทุกหน้า */
.wrap { max-width: 1080px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; position: sticky; top: 0; z-index: 5; background: var(--bg); }
.logo { white-space: nowrap; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; font-size: 18px; }
.logo img { width: 36px; height: 36px; border-radius: 9px; display: block; }
.bar nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.bar nav a { text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.bar nav a:hover, .bar nav a:focus-visible { background: var(--surface); outline: none; }
.bar nav a[aria-current="page"] { background: var(--surface); }
@media (max-width: 760px) { .bar nav .hide-sm { display: none; } }

.foot { border-top: 1px solid var(--line); margin-top: 24px; padding-block: 32px 40px; color: var(--muted); font-size: 14px; display: grid; gap: 20px; }
.foot .logo { color: var(--fg); }
.foot .logo small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); line-height: 1.3; }
.foot .logo > span { line-height: 1.2; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot-links a, .foot-bottom a { color: var(--muted); text-decoration: none; font-weight: 500; }
.foot-links a:hover, .foot-links a:focus-visible, .foot-bottom a:hover, .foot-bottom a:focus-visible { color: var(--accent); text-decoration: underline; outline: none; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }

/* ส่วนหัวหน้าแรก */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding-block: 24px 56px; }
.hero h1 { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.2; margin: 0 0 16px; letter-spacing: -0.5px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 24px; max-width: 34em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 24px; list-style: none; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 500; }
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 6px; }
.stores img { display: block; height: 48px; width: auto; }
.stores .soon { opacity: .55; }
.stores-note { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.phones { position: relative; display: flex; justify-content: center; align-items: flex-start; min-height: 420px; }
.phones .iphone { width: min(46%, 240px); }
.phones .p2 { margin-left: -14%; margin-top: 56px; }

/* กรอบ iPhone ทำด้วย CSS: ขนาดทุกส่วนเป็นสัดส่วนกับความกว้างเครื่อง (cqw) */
.iphone { container-type: inline-size; position: relative; flex: none; }
.iphone .screen { position: relative; overflow: hidden; background: #FCF8F5; border-radius: 13.5cqw;
  border: 4.2cqw solid #0B0B10; box-shadow: 0 0 0 .7cqw #4A4A55, 0 24px 48px -20px rgb(15 23 42 / .45); }
.iphone img { display: block; width: 100%; height: auto; aspect-ratio: 390 / 844; }
.iphone .sb { height: 12.5cqw; display: flex; align-items: center; justify-content: space-between; padding: 1.4cqw 7.5cqw 0 9cqw; color: #111; }
.iphone .sb .t { font: 600 4.3cqw/1 -apple-system, 'SF Pro Text', var(--font); letter-spacing: -.1px; }
.iphone .island { position: absolute; top: 2.6cqw; left: 50%; transform: translateX(-50%); width: 30cqw; height: 8.6cqw; border-radius: 99px; background: #0B0B10; }
.iphone .ic3 { display: flex; gap: 1.4cqw; align-items: center; }
.iphone .ic3 svg { height: 3cqw; width: auto; fill: currentColor; }
.iphone .home { position: absolute; bottom: 1.8cqw; left: 50%; transform: translateX(-50%); width: 33cqw; height: 1.3cqw; border-radius: 99px; background: #111; opacity: .85; }
/* ปุ่มข้างเครื่อง: ซ้าย Action + เสียง · ขวา Power */
.iphone::before { content: ""; position: absolute; left: -1.1cqw; top: 20cqw; width: 1.1cqw; height: 7cqw; border-radius: 1cqw 0 0 1cqw; background: #4A4A55;
  box-shadow: 0 13cqw 0 0 #4A4A55; }
.iphone::after { content: ""; position: absolute; right: -1.1cqw; top: 34cqw; width: 1.1cqw; height: 20cqw; border-radius: 0 1cqw 1cqw 0; background: #4A4A55; }
/* แบบขอบขาว: เครื่องสีขาว ขอบนอกเทาอ่อน */
.iphone.white .screen { border-color: #FFFFFF; box-shadow: 0 0 0 .7cqw #D9D6DE, 0 24px 48px -20px rgb(15 23 42 / .35); }
.iphone.white::before { background: #D9D6DE; box-shadow: 0 13cqw 0 0 #D9D6DE; }
.iphone.white::after { background: #D9D6DE; }

/* ห้าธาตุ */
.elements { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 24px; list-style: none; }
.elements li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.elements i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgb(0 0 0 / .12); }

/* ส่วนเนื้อหา */
section { padding-block: 52px; border-top: 1px solid var(--line); scroll-margin-top: 72px; }
h2 { font-size: 30px; line-height: 1.3; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 28px; max-width: 42em; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 20px 16px; }
.card h3 { margin: 12px 0 6px; font-size: 17px; line-height: 1.4; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--tile); }
.ic svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card > .pbadge { position: absolute; top: 16px; right: 16px; }
.pbadge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; line-height: 1.5; background: linear-gradient(90deg, #FDE68A, #E3B75A); color: #5A3E08; font-weight: 700; }

/* เริ่มใช้ */
.start { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: center; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.steps li::before { content: counter(s); width: 40px; height: 40px; border-radius: 50%; background: var(--night); color: var(--gold); font-weight: 700; display: grid; place-items: center; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 15px; }
.start .shot { width: 100%; }
@media (max-width: 760px) { .start { grid-template-columns: 1fr; } .start .shot { max-width: 260px; margin: 0 auto; } }

/* ฟรี / พรีเมียม */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.plan.pro { border: 2px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, #FDE68A, #C98A12) border-box; }
.plan.pro .gold { background: linear-gradient(90deg, var(--gold-a), var(--gold-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan h3 { margin: 0 0 2px; font-size: 20px; }
.price { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.plan-note { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.plan ul { margin: 0; padding-left: 1.2em; }
.plan li { margin: 4px 0; }
.fine { color: var(--muted); font-size: 14px; margin: 14px 0 0; max-width: 70ch; }

/* ความเป็นส่วนตัว */
.privacy { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.privacy p { margin: 0; }
.privacy svg { width: 44px; height: 44px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* คำถาม */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; margin-bottom: 10px; max-width: 820px; }
summary { font-weight: 600; cursor: pointer; }
details p { margin: 8px 0 0; color: var(--muted); }
.terms li { color: var(--muted); max-width: 65ch; }
.contact { font-weight: 600; color: var(--gold-deep); }

@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 4px; }
  .phones { min-height: 0; }
  .privacy { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
}
@media (max-width: 460px) { .grid { grid-template-columns: 1fr; } }

/* หน้าเอกสาร (แผนงาน อัปเดต ข้อกำหนด ความเป็นส่วนตัว) */
.page-head { padding-block: 28px 20px; }
.page-head h1 { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.25; margin: 0 0 6px; }
.page-head p { color: var(--muted); margin: 0; }
.doc { max-width: 780px; padding-block: 8px 48px; }
.doc.wide { max-width: none; }
.doc h2 { font-size: 24px; margin-top: 1.8em; }
.doc h3 { margin-top: 1.4em; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin-bottom: 6px; }
.contactbox { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; margin: 8px 0; }
.doc details { max-width: none; }

/* ช่วยเหลือ: คำถามด้านซ้าย สารบัญและการ์ดติดต่อด้านขวา (ติดจอเมื่อเลื่อน) */
.help { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; align-items: start; }
.help .help-main { max-width: none; padding-top: 0; }
.faq-group { padding: 0; border: 0; }
.faq-group h2 { margin-top: 1.4em; scroll-margin-top: 76px; }
.faq-group:first-of-type h2 { margin-top: .6em; }
.help-side { position: sticky; top: 76px; display: grid; gap: 14px; padding-bottom: 24px; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 12px 10px; }
.toc b { display: block; padding: 0 8px 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 10px; text-decoration: none; color: var(--fg); font-weight: 500; }
.toc a:hover, .toc a:focus-visible { background: var(--tile); outline: none; }
.toc a span { color: var(--muted); font-size: 13px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; font-size: 15px; }
.side-card p { margin: 2px 0 8px; color: var(--muted); }
.sm-only { display: none; }
@media (max-width: 900px) {
  .help { grid-template-columns: 1fr; }
  .help-side { display: none; }
  .sm-only { display: block; }
}
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-top: 16px; }
.summary ul { margin: 8px 0 0; padding-left: 20px; }
.note { background: #FFF7E2; border: 1px solid #F0D9A3; color: #6B4E12; border-radius: 12px; padding: 12px 16px; font-size: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .note { background: #2D2715; border-color: #5A4A1F; color: #F0D9A3; } }
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); font-size: 15px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--tile); font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* แผนงาน */
.lanes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-bottom: 8px; }
@media (max-width: 860px) { .lanes { grid-template-columns: 1fr; } }
.lane h3 { display: flex; align-items: center; gap: 8px; }
.pill { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--night); color: var(--gold); font-weight: 600; }
.lane ul { list-style: none; padding: 0; margin: 0; }
.lane li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.lane li b { display: block; }
.lane li span { color: var(--muted); font-size: 15px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.tag.free { background: #E5F4E4; color: #1F6A3A; } .tag.pro { background: #FFF1CC; color: #7A5408; }
.ideas-row { margin-top: 28px; padding-top: 24px; border-top: 1px dashed var(--line); }
.ideas-row h3 { display: flex; align-items: center; gap: 8px; }
.ideas-row .pill { background: var(--line); color: var(--muted); }
.ideas { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ideas li { background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 12px 14px; }
.ideas li b { display: block; }
.ideas li span:not(.tag) { color: var(--muted); font-size: 15px; }
.center { text-align: center; }

/* บันทึกการอัปเดต */
[hidden] { display: none !important; }
.release { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; margin-top: 18px; scroll-margin-top: 84px; }
.doc .release h2 { margin: 0; font-size: 21px; }
.release .meta { color: var(--muted); font-size: 14px; margin: 2px 0 10px; }
.doc .release h3 { font-size: 16px; margin: 16px 0 4px; }
.release ul { margin: 4px 0 0; }
.release li { margin: 4px 0; }
.release .tag.new { color: var(--gold-deep); border: 1px solid currentColor; border-radius: 999px; font-weight: 600; padding: 1px 9px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .release .tag.new { color: var(--gold); } }
.release > details { background: none; border: 0; border-radius: 0; padding: 0; margin: 0; max-width: none; }
.release > details > summary { font-weight: inherit; list-style: none; cursor: pointer; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-radius: 10px; }
.release > details > summary::-webkit-details-marker { display: none; }
.release > details > summary::after { content: ""; flex: none; width: 10px; height: 10px; margin: 9px 4px 0 0; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; }
.release > details[open] > summary::after { transform: rotate(-135deg); margin-top: 14px; }
.release > details:not([open]) .meta { margin-bottom: 0; }
.rtools { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 8px 0 4px; }
html:not(.js) .rtools { display: none; }
.rtools input { flex: 1 1 220px; min-width: 0; font: inherit; font-size: 16px; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; }
.rtools input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rtools button { font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.rtools button:hover, .rtools button:focus-visible { border-color: var(--accent); outline: none; }
.rstatus { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 14px; }
.rstatus:empty { display: none; }
