/* โทเคนสีจาก EbblyCore/Theme.swift เท่านั้น · โหมดสว่างอย่างเดียว (ตรงกับแอป v1) */
:root {
  --canvas: #EBE6E1;
  --surface: #FAF7F4;
  --raised: #FFFFFF;
  --ink: #16110D;
  --muted: #675E57;
  --accent: #FBBE2C;
  --accent-soft: #EFDDB9;
  --income: #3F5420;
  --craving: #E08A3C;
  --sage: #A3AD98;
  --pass: #7E9B3F;
  --log: #5C3A2E;
  --font: ui-rounded, 'IBM Plex Sans Thai Looped', system-ui, sans-serif;
  color-scheme: light;
}
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--raised); color: var(--ink); font-family: var(--font); }
a { color: var(--ink); }
a:hover { color: var(--log); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nw { white-space: nowrap; }

/* หัวเว็บ — ใช้ทุกหน้า */
.site-head { max-width: 1200px; margin: 0 auto; padding: 14px 20px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--canvas); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand span { font-size: 23px; font-weight: 700; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a { text-decoration: none; font-size: 16px; padding: 12px 14px; }
@media (max-width: 760px) { .nav-links { display: none; } }
.btn-join { text-decoration: none; background: var(--ink); color: var(--raised); font-size: 15px; font-weight: 700; padding: 11px 20px; border-radius: 14px; }
.btn-join:hover { color: var(--raised); }

/* ท้ายเว็บ */
.site-foot { max-width: 1120px; margin: 0 auto; padding: 8px 20px 40px; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 14px; color: var(--muted); }
.site-foot > span { display: flex; align-items: center; gap: 8px; }
.site-foot > span img { width: 24px; height: 24px; border-radius: 6px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-foot nav a { color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; }

/* หน้าข้อความยาว: /privacy /support */
.doc { max-width: 760px; margin: 0 auto; padding: 40px 20px 72px; box-sizing: border-box; font-size: 17px; line-height: 1.75; }
.doc h1 { margin: 0 0 8px; font-size: clamp(32px, 5vw, 44px); line-height: 1.25; font-weight: 700; }
.doc h2 { margin: 40px 0 10px; font-size: 24px; line-height: 1.35; font-weight: 700; }
.doc h3 { margin: 28px 0 8px; font-size: 19px; line-height: 1.4; font-weight: 700; }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 14px; padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc .lead { color: var(--muted); }
.doc .note { background: var(--surface); border-radius: 20px; padding: 18px 20px; margin: 18px 0; }
.doc .note p:last-child, .doc .note ul:last-child { margin-bottom: 0; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--surface); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border-radius: 18px; border: 1.5px solid var(--canvas); }
.doc table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15.5px; line-height: 1.6; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--canvas); }
.doc th { background: var(--surface); font-weight: 700; }
.doc tr:last-child td { border-bottom: 0; }
.doc details { background: var(--surface); border-radius: 20px; padding: 0 22px; margin: 0 0 10px; }
.doc details p, .doc details ul { color: var(--muted); }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.faq-q { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 18px; font-weight: 700; line-height: 1.45; }
.faq-q::after { content: "+"; font-size: 22px; flex: 0 0 auto; }
details[open] > .faq-q::after { content: "−"; }
.contact { background: var(--surface); border-radius: 28px; padding: 24px; margin: 24px 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.contact img { width: 84px; height: 84px; }
.contact div { flex: 1 1 260px; min-width: 0; }
.contact b { font-size: 20px; }
.contact p { margin: 4px 0 0; }
.contact a.mail { display: inline-flex; align-items: center; min-height: 48px; margin-top: 8px; padding: 0 22px; border-radius: 999px; background: var(--ink); color: var(--raised); font-weight: 700; text-decoration: none; }

/* การ์ดกลางจอ: /confirm /unsubscribe /404 */
.slim { width: 100%; max-width: 440px; margin: 0 auto; min-height: 100svh; box-sizing: border-box; padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 18px; }
.slim .brand { height: 48px; }
.slim .brand span { font-size: 22px; }
.pill-btn { min-height: 52px; border: 2px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; padding: 0 20px; box-sizing: border-box; }
.pill-btn.dark { background: var(--ink); color: var(--raised); border-color: var(--ink); height: 56px; font-size: 17px; }
.pill-btn.dark:hover { color: var(--raised); }
.pill-btn[disabled] { opacity: .85; cursor: default; }
