:root {
  --bg: #f6f2e9;
  --surface: #fffdf8;
  --text: #1b1c21;
  --muted: #5b5d66;
  --line: #ddd6c6;
  --accent: #8a3b12;
  --accent-bg: #f1e4d6;
  --head: #1b1c21;
  --head-text: #f6f2e9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131417;
    --surface: #1b1c21;
    --text: #efeadc;
    --muted: #a6a7b0;
    --line: #34363f;
    --accent: #e6a77c;
    --accent-bg: #2a2420;
    --head: #0e0f11;
    --head-text: #efeadc;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.75 "Noto Sans Thai", "Sarabun", "Leelawadee UI", "Thonburi", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.bar { background: var(--head); color: var(--head-text); }
.bar-in, .wrap, .foot-in { width: 100%; max-width: 62rem; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; display: block; }
.bar nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.bar nav a { color: var(--head-text); text-decoration: none; padding: 8px 2px; font-size: .95rem; opacity: .85; }
.bar nav a:hover, .bar nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }
.bar nav a.lang { border: 1px solid currentColor; border-radius: 6px; padding: 4px 10px; opacity: .9; text-decoration: none; }
.bar a:focus-visible { outline-color: var(--head-text); }
main { flex: 1; }
.hero { padding: 72px 0 56px; }
.hero h1 { font-size: clamp(2.4rem, 9vw, 4.2rem); line-height: 1.1; margin: 0 0 20px; letter-spacing: -.02em; }
.hero p.lead { font-size: clamp(1.1rem, 3.6vw, 1.4rem); line-height: 1.7; max-width: 36rem; margin: 0 0 32px; }
.links { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; padding: 10px 20px; border-radius: 8px; border: 1.5px solid var(--text); color: var(--text); text-decoration: none; font-weight: 600; }
.btn:hover { background: var(--text); color: var(--bg); }
.badges { margin-top: 36px; min-height: 0; } /* store badges go here when the apps are public */
.wrap { padding-top: 40px; padding-bottom: 56px; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 16px; }
@media (min-width: 640px) { .doc { padding: 36px 40px; } }
.doc h1 { font-size: clamp(1.5rem, 5vw, 2rem); line-height: 1.35; margin: 0 0 4px; }
.doc .meta { color: var(--muted); font-size: .9rem; margin: 0; }
.doc section { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; }
.doc h2 { font-size: 1.15rem; margin: 0 0 8px; line-height: 1.45; }
.doc h3 { font-size: 1rem; margin: 18px 0 4px; }
.doc p { margin: 8px 0; }
.doc ul { margin: 8px 0; padding-left: 1.3rem; }
.doc li { margin: 4px 0; }
.doc p, .doc li, .doc td { overflow-wrap: anywhere; }
.tbl { overflow-x: auto; margin: 12px 0; }
.tbl table { border-collapse: collapse; width: 100%; font-size: .93rem; line-height: 1.6; min-width: 34rem; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.tbl th { background: var(--accent-bg); }
.mail { font-size: clamp(1.1rem, 4.5vw, 1.5rem); font-weight: 700; overflow-wrap: anywhere; }
footer { background: var(--head); color: var(--head-text); font-size: .9rem; }
.foot-in { padding-top: 24px; padding-bottom: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
footer a { color: var(--head-text); }
footer a:focus-visible { outline-color: var(--head-text); }
.nf { padding: 80px 0; }
.nf .code { font-size: 4rem; font-weight: 800; line-height: 1; margin: 0 0 12px; color: var(--accent); }
.hero-in { padding-top: 0; padding-bottom: 0; }
.co { margin-top: 40px; color: var(--muted); }
