/* สไตล์กลางของหน้าเอกสาร (privacy / terms / about)
   - typography ปรับให้อ่านภาษาไทยสบายตา (line-height สูง, ความกว้างบรรทัดพอดี)
   - รองรับโหมดมืดอัตโนมัติ + สไตล์สำหรับสั่งพิมพ์ */

:root {
  --bg: #f7f9fa;
  --surface: #ffffff;
  --text: #1f2937;
  --text-soft: #52616f;
  --text-faint: #7b8794;
  --brand: #0f766e;
  --brand-soft: #0d9488;
  --line: #e3e8ec;
  --line-soft: #eef2f5;
  --accent-bg: #f0fdfa;
  --accent-line: #99f6e4;
  --warn-bg: #fffbeb;
  --warn-line: #fcd34d;
  --radius: 14px;
  --measure: 40rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1416;
    --surface: #171e21;
    --text: #e5eaed;
    --text-soft: #b3bec5;
    --text-faint: #8a969e;
    --brand: #5eead4;
    --brand-soft: #2dd4bf;
    --line: #2a3439;
    --line-soft: #222b2f;
    --accent-bg: #10302c;
    --accent-line: #14615a;
    --warn-bg: #2e2717;
    --warn-line: #6b5518;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans Thai", "IBM Plex Sans Thai", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.85;            /* ภาษาไทยมีสระบน-ล่าง ต้องการระยะบรรทัดมากกว่าปกติ */
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- หัวเอกสาร ---------- */
.doc-head {
  background: var(--brand);
  color: #fff;
  padding: 2.75rem 0 2.25rem;
  margin-bottom: 2.5rem;
}
@media (prefers-color-scheme: dark) {
  .doc-head { background: #0c3b38; }
}
.doc-head .wrap { max-width: 44rem; }
.doc-head .eyebrow {
  margin: 0 0 .5rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7dd3c8;
}
.doc-head h1 {
  margin: 0 0 .6rem;
  font-size: 1.9rem;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: #fff;
}
.doc-head .meta {
  margin: 0;
  font-size: .9rem;
  color: #b8e6e0;
}

/* ---------- สารบัญ ---------- */
.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin: 0 0 2.5rem;
}
.toc h2 {
  margin: 0 0 .6rem;
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 0;
  padding: 0;
}
.toc ol {
  margin: 0;
  padding-left: 1.35rem;
  columns: 2;
  column-gap: 1.75rem;
  font-size: .95rem;
}
.toc li { margin: .18rem 0; break-inside: avoid; }
.toc a { color: var(--text-soft); text-decoration: none; }
.toc a:hover { color: var(--brand-soft); text-decoration: underline; }
@media (max-width: 34rem) { .toc ol { columns: 1; } }

/* ---------- หัวข้อ ---------- */
h2 {
  margin: 3rem 0 .85rem;
  padding-bottom: .45rem;
  border-bottom: 2px solid var(--line);
  font-size: 1.28rem;
  line-height: 1.5;
  color: var(--brand);
  scroll-margin-top: 1.5rem;
}
h2 .num {
  display: inline-block;
  min-width: 1.6rem;
  color: var(--text-faint);
  font-weight: 700;
}
h3 {
  margin: 1.9rem 0 .4rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
}

p { margin: .85rem 0; color: var(--text-soft); }
strong { color: var(--text); font-weight: 700; }

ul, ol { padding-left: 1.4rem; margin: .8rem 0; }
li { margin: .45rem 0; color: var(--text-soft); }
li::marker { color: var(--brand-soft); }

a { color: var(--brand-soft); text-underline-offset: 2px; }

/* ---------- กล่องเน้น ---------- */
.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.4rem;
  margin: 1.5rem 0;
}
.box > :first-child { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }
.box.accent { background: var(--accent-bg); border-color: var(--accent-line); }
.box.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.box .label {
  display: block;
  margin-bottom: .5rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- ตาราง ---------- */
.tablewrap { overflow-x: auto; margin: 1.2rem 0; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  font-size: .94rem;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td {
  border-bottom: 1px solid var(--line-soft);
  padding: .7rem .9rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.65;
}
th {
  background: var(--line-soft);
  color: var(--text);
  font-weight: 700;
  font-size: .88rem;
  white-space: nowrap;
}
td { color: var(--text-soft); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- ท้ายเอกสาร ---------- */
.doc-foot {
  margin-top: 3.5rem;
  padding: 1.6rem 0 3rem;
  border-top: 1px solid var(--line);
  font-size: .92rem;
  color: var(--text-faint);
}
.doc-foot nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-bottom: .8rem; }
.doc-foot a { color: var(--brand-soft); text-decoration: none; font-weight: 600; }
.doc-foot a:hover { text-decoration: underline; }

/* ---------- สั่งพิมพ์ ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.6; }
  .doc-head { background: #fff !important; color: #000; padding: 0 0 1rem; border-bottom: 2px solid #000; }
  .doc-head h1, .doc-head .eyebrow, .doc-head .meta { color: #000; }
  .toc, .doc-foot { display: none; }
  h2 { color: #000; page-break-after: avoid; }
  .box, table { border-color: #999; }
  a { color: #000; text-decoration: underline; }
}
