/* คู่มือการคลี่แบบ (/guide/*.html) — หน้า HTML ธรรมดา ไม่ผ่าน React ให้ Google อ่านเนื้อหาได้
   ห้ามใส่ <script> ในหน้า (CSP ของ nginx อนุญาตแค่ไฟล์ script จากโดเมนเดียวกัน) และห้ามใส่สูตรคำนวณ */
:root {
  --bg: #f4f6f5;
  --paper: #ffffff;
  --ink: #1a2530;
  --ink-soft: #4a5966;
  --line: #d9e0de;
  --cyan: #0e7490;
  --cyan-tint: #e3f4f8;
  --amber: #b4690e;
  --amber-tint: #fdf3e2;
  --radius: 14px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans Thai', 'Leelawadee UI', Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.8;
}

a {
  color: var(--cyan);
}

.top {
  background: #0d1015;
  color: #e7eef6;
}

.top__inner,
main,
.foot__inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e7eef6;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
}

.cta {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: #2dd4ff;
  color: #04222c;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.cta--amber {
  background: #f8b74d;
  color: #2a1a00;
}

main {
  padding-top: 24px;
  padding-bottom: 48px;
}

.crumbs {
  font-size: 14px;
  color: var(--ink-soft);
}

h1 {
  font-size: 32px;
  line-height: 1.3;
  margin: 8px 0 12px;
}

h2 {
  font-size: 24px;
  line-height: 1.4;
  margin: 40px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 19px;
  margin: 24px 0 8px;
}

.lead {
  font-size: 19px;
  color: var(--ink-soft);
}

.toc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 20px;
}

.toc ol {
  margin: 0;
  padding-left: 22px;
}

figure {
  margin: 20px 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

figure img.tall {
  max-height: 640px;
  width: auto;
}

figcaption {
  margin-top: 8px;
  font-size: 15px;
  color: var(--ink-soft);
}

.video {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #0d1015;
  border-color: #0d1015;
}

.video video {
  display: block;
  width: 100%;
  max-width: 340px;
  border-radius: 10px;
}

.video figcaption {
  color: #a7b6c9;
}

table.fields {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  font-size: 16px;
}

table.fields th,
table.fields td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

table.fields th {
  background: var(--cyan-tint);
}

table.fields td:nth-child(2) {
  white-space: nowrap;
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

.note,
.warn {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0;
}

.note {
  background: var(--cyan-tint);
  border-left: 5px solid var(--cyan);
}

.warn {
  background: var(--amber-tint);
  border-left: 5px solid var(--amber);
}

ol.steps > li {
  margin-bottom: 8px;
}

.cards {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.cards a {
  display: block;
  height: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--ink);
  text-decoration: none;
}

.cards a:hover {
  border-color: var(--cyan);
}

.cards img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
  margin-bottom: 8px;
}

.cards strong {
  display: block;
  font-size: 18px;
}

.cards span {
  font-size: 15px;
  color: var(--ink-soft);
}

.end-cta {
  margin-top: 40px;
  background: #0d1015;
  color: #e7eef6;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.end-cta p {
  margin: 0 0 14px;
  font-size: 19px;
}

.foot {
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-soft);
}

.foot__inner {
  padding-top: 16px;
  padding-bottom: 24px;
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 21px;
  }

  .top .cta {
    padding: 8px 14px;
    font-size: 14px;
  }

  /* ตารางช่องกรอก: จอแคบเรียงเป็นการ์ดทีละช่อง (ชื่อช่อง → ตัวอย่าง → ความหมาย) แทน 3 คอลัมน์ที่บีบจนอ่านยาก */
  table.fields thead {
    display: none;
  }

  table.fields,
  table.fields tbody,
  table.fields tr,
  table.fields td {
    display: block;
    width: 100%;
  }

  table.fields tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
  }

  table.fields td {
    border: 0;
    padding: 4px 12px;
  }

  table.fields td:first-child {
    background: var(--cyan-tint);
    font-weight: 700;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  table.fields td:nth-child(2) {
    white-space: normal;
    color: var(--cyan);
    padding-top: 8px;
  }

  table.fields td:last-child {
    padding-bottom: 10px;
  }
}

@media print {
  .top,
  .video,
  .end-cta,
  .foot {
    display: none;
  }
}
