﻿@charset "UTF-8";
:root {
  --paper: #f5efe0;
  --paper-2: #ece3cc;
  --card: #fffdf6;
  --ink: #2b2a22;
  --muted: #6b6553;
  --line: #ddd2b5;
  --khaki: #c9b88c;
  --khaki-d: #8a7647;
  --forest: #2d4a35;
  --forest-2: #3e6448;
  --forest-l: #e2e9dc;
  --purple: #5a2d82;
  --purple-l: #ece4f3;
  --rope: #b38d55;
  --c-history: #94631a;
  --c-charter: #5a2d82;
  --c-skills: #2f6a3d;
  --c-nature: #24486f;
  --c-safety: #a43a2c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 45, 10, .06), 0 6px 20px rgba(60, 45, 10, .07);
  --head: 'Kanit', 'Sarabun', sans-serif;
  --body: 'Sarabun', 'Kanit', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.75 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--forest-2); }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 500; line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4.6vw, 44px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
.ic { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* เส้นเชือกคั่น */
.rope {
  height: 10px; margin: 36px 0;
  background:
    repeating-linear-gradient(115deg, var(--rope) 0 5px, #d8b97f 5px 8px, var(--rope) 8px 10px);
  border-radius: 6px;
  opacity: .55;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

/* ส่วนหัว */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--forest);
  color: #f3ecd8;
  border-bottom: 4px solid var(--khaki);
}
.top .wrap { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--khaki); color: var(--forest);
  box-shadow: 0 0 0 3px var(--forest), 0 0 0 5px var(--rope);
}
.brand-mark .ic { width: 28px; height: 28px; stroke-width: 1.9; }
.brand-text { font-family: var(--head); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text b { display: block; font-weight: 500; font-size: 18px; }
.brand-text small { font-size: 12.5px; opacity: .8; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  color: #efe6cf; text-decoration: none; font-family: var(--head); font-size: 15.5px;
  padding: 8px 13px; border-radius: 999px; display: flex; align-items: center; gap: 7px;
}
.nav a:hover { background: rgba(255,255,255,.09); }
.nav a.on { background: var(--khaki); color: var(--forest); }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; color: inherit; padding: 8px; cursor: pointer; }
.menu-btn .ic { width: 26px; height: 26px; }

@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 70px;
    flex-direction: column; background: var(--forest); padding: 8px 16px 16px;
    border-bottom: 4px solid var(--khaki);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 10px; }
}

/* ฮีโร่หน้าแรก */
.hero { background: var(--forest); color: #f5eedb; overflow: hidden; position: relative; }
.hero::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 14px;
  background: repeating-linear-gradient(115deg, var(--rope) 0 6px, #d8b97f 6px 10px, var(--rope) 10px 12px);
}
.hero .wrap { display: grid; grid-template-columns: 1.25fr .9fr; gap: 48px; align-items: center; padding-top: 56px; padding-bottom: 72px; }
.hero h1 { color: #fff7e2; }
.hero .kicker { font-family: var(--head); color: var(--khaki); letter-spacing: .04em; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hero .lead { font-size: 19px; color: #e4dcc4; max-width: 34em; }
.authors { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 28px; }
.author {
  background: rgba(255,255,255,.07); border: 1px solid rgba(201,184,140,.45);
  border-radius: 12px; padding: 8px 14px; font-family: var(--head); font-size: 15.5px;
}
.author small { display: block; color: var(--khaki); font-size: 12.5px; letter-spacing: .06em; }
.photo-frame {
  position: relative; border-radius: 18px; padding: 10px;
  background: var(--khaki); transform: rotate(1.5deg);
  box-shadow: 0 20px 40px rgba(0,0,0,.3);
}
.photo-frame img { border-radius: 10px; aspect-ratio: 4/4.4; object-fit: cover; object-position: center 62%; width: 100%; }
.photo-frame .tag {
  position: absolute; left: -14px; bottom: 26px; transform: rotate(-4deg);
  background: var(--purple); color: #fff; font-family: var(--head); font-size: 14px;
  padding: 6px 14px; border-radius: 8px; display: flex; gap: 6px; align-items: center;
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; }
  .photo-frame { max-width: 380px; margin: 0 auto; }
}

/* ปุ่ม */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 16px/1 var(--head); text-decoration: none; cursor: pointer;
  padding: 13px 20px; border-radius: 999px; border: 1.5px solid transparent;
  background: var(--khaki); color: var(--forest);
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn.dark { background: var(--forest); color: #f5eedb; }
.btn.purple { background: var(--purple); color: #fff; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* ตัวเลขสถิติ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: -40px; position: relative; z-index: 2; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  display: flex; gap: 14px; align-items: center; border: 1px solid var(--line);
}
.stat .ic { width: 38px; height: 38px; color: var(--forest-2); padding: 7px; background: var(--forest-l); border-radius: 50%; }
.stat b { font: 500 28px/1 var(--head); display: block; }
.stat span { color: var(--muted); font-size: 14.5px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* หัวข้อส่วน */
.sec { padding-top: 56px; padding-bottom: 8px; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.sec-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.sec-head h2 .ic { color: var(--khaki-d); }
.sec-head p { margin: 4px 0 0; color: var(--muted); }
.more { font-family: var(--head); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }

/* หมวด */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.cat {
  --c: var(--forest);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: inherit; position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cat::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--c); }
.cat .badge-ic { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c); margin-bottom: 12px; }
.cat .badge-ic .ic { width: 28px; height: 28px; }
.cat h3 { margin-bottom: 4px; }
.cat p { font-size: 14.5px; color: var(--muted); margin: 0 0 10px; line-height: 1.6; }
.cat .count { font-family: var(--head); color: var(--c); font-size: 14px; }
[data-cat=history] { --c: var(--c-history); }
[data-cat=charter] { --c: var(--c-charter); }
[data-cat=skills]  { --c: var(--c-skills); }
[data-cat=nature]  { --c: var(--c-nature); }
[data-cat=safety]  { --c: var(--c-safety); }

/* ปกหนังสือ */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 26px 20px; }
.bk { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 10px; }
.bk-cover {
  position: relative; border-radius: 4px 10px 10px 4px; overflow: hidden;
  aspect-ratio: 3/4; background: var(--paper-2);
  box-shadow: inset 6px 0 0 rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.12), 0 10px 20px rgba(60,45,10,.14);
  transition: transform .18s, box-shadow .18s;
}
.bk:hover .bk-cover { transform: translateY(-5px) rotate(-.6deg); box-shadow: inset 6px 0 0 rgba(0,0,0,.12), 0 18px 30px rgba(60,45,10,.22); }
.bk-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.bk-no {
  position: absolute; top: 8px; right: 8px; font: 500 14px/1 var(--head);
  background: var(--forest); color: #f5eedb; border-radius: 999px; padding: 6px 10px;
  box-shadow: 0 0 0 2px var(--khaki);
}
.bk-cat { position: absolute; left: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; box-shadow: 0 0 0 2px #fff; }
.bk-cat .ic { width: 20px; height: 20px; }
.bk-title { font: 500 16px/1.35 var(--head); }
.bk-meta { font-size: 13.5px; color: var(--muted); display: flex; gap: 10px; }

/* ตัวกรอง */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; align-items: center; }
.chip {
  --c: var(--forest);
  font: 15px/1 var(--head); padding: 10px 15px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; gap: 7px;
}
.chip .ic { color: var(--c); }
.chip.on { background: var(--c); border-color: var(--c); color: #fff; }
.chip.on .ic { color: #fff; }
.search-box { position: relative; flex: 1 1 260px; max-width: 420px; margin-left: auto; }
.search-box input {
  width: 100%; font: 16px var(--body); padding: 11px 16px 11px 44px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
}
.search-box input:focus { outline: none; border-color: var(--forest-2); box-shadow: 0 0 0 3px var(--forest-l); }
.search-box .ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* หน้าเล่ม */
.page-head { background: var(--paper-2); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-top: 34px; padding-bottom: 34px; }
.crumbs { font-size: 14.5px; color: var(--muted); margin-bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: inherit; }
.book-hero { display: grid; grid-template-columns: 250px 1fr; gap: 38px; align-items: start; }
.book-hero .bk-cover { max-width: 250px; }
.pill {
  --c: var(--forest);
  display: inline-flex; align-items: center; gap: 6px; font: 14px/1 var(--head);
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
  padding: 7px 12px; border-radius: 999px; text-decoration: none;
}
.book-hero h1 { margin: 12px 0 4px; }
.book-hero .sub { font-family: var(--head); color: var(--khaki-d); font-size: 18px; margin-bottom: 14px; }
.book-hero .summary { font-size: 18px; max-width: 46em; }
.facts { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 15px; margin: 6px 0 22px; }
.facts span { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 760px) {
  .book-hero { grid-template-columns: 1fr; }
  .book-hero .bk-cover { max-width: 200px; }
}

.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.hl {
  background: var(--forest); color: #f5eedb; border-radius: var(--radius); padding: 20px 22px;
  position: relative; overflow: hidden;
}
.hl:nth-child(2) { background: var(--purple); }
.hl:nth-child(3) { background: var(--khaki-d); }
.hl:nth-child(4) { background: var(--forest-2); }
.hl b { display: block; font: 500 clamp(24px, 3vw, 32px)/1.15 var(--head); margin-bottom: 6px; }
.hl span { font-size: 15px; opacity: .9; line-height: 1.5; display: block; }
.hl .ic { position: absolute; right: -8px; bottom: -8px; width: 74px; height: 74px; opacity: .14; }

.sections { columns: 2 380px; column-gap: 18px; }
.sect {
  break-inside: avoid; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px;
}
.sect h3 { display: flex; gap: 10px; align-items: center; }
.sect h3 .ic { width: 34px; height: 34px; padding: 6px; border-radius: 50%; color: #fff; background: var(--c, var(--forest)); }
.sect ul { margin: 0; padding: 0; list-style: none; }
.sect li { position: relative; padding-left: 22px; margin-bottom: 7px; font-size: 16px; line-height: 1.65; }
.sect li::before {
  content: ''; position: absolute; left: 3px; top: .62em; width: 8px; height: 8px;
  border: 2px solid var(--c, var(--forest)); border-radius: 50%;
}

/* ขั้นตอน: เส้นทางเดินป่า */
.steps { counter-reset: s; position: relative; padding-left: 8px; }
.step { position: relative; padding: 0 0 22px 58px; }
.step::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font: 500 17px/1 var(--head);
  background: var(--khaki); color: var(--forest); box-shadow: 0 0 0 4px var(--paper);
  z-index: 1;
}
.step::after { content: ''; position: absolute; left: 19px; top: 40px; bottom: 0; border-left: 2px dashed var(--khaki-d); }
.step:last-child::after { display: none; }
.step h4 { font-size: 17.5px; margin: 6px 0 4px; }
.step p { margin: 0; color: var(--muted); }

.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.term { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--c, var(--khaki)); border-radius: 10px; padding: 14px 16px; }
.term b { font-family: var(--head); font-weight: 500; display: block; }
.term .shape { font-size: 13.5px; color: var(--khaki-d); margin: 2px 0 4px; display: flex; gap: 6px; align-items: center; }
.term p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.6; }

.quote {
  font: 300 clamp(20px, 2.6vw, 26px)/1.6 var(--head); text-align: center;
  max-width: 40em; margin: 0 auto; padding: 28px 20px; color: var(--forest);
}
.quote .ic { width: 34px; height: 34px; color: var(--khaki-d); display: block; margin: 0 auto 10px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-k { background: var(--paper-2); border-radius: 999px; padding: 5px 13px; font-size: 14.5px; text-decoration: none; color: var(--ink); }
.tag-k:hover { background: var(--khaki); }
.refs { font-size: 14.5px; color: var(--muted); padding-left: 20px; }

.pdf-view { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #555; }
.pdf-view iframe { width: 100%; height: 78vh; border: 0; display: block; }
.pager { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pager a {
  flex: 1 1 260px; display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px;
}
.pager a.next { justify-content: flex-end; text-align: right; }
.pager small { display: block; color: var(--muted); font-size: 13px; }

/* เส้นเวลา */
.tl-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.era-toggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; margin-left: auto; }
.era-toggle button { font: 15px/1 var(--head); padding: 10px 14px; border: 0; background: var(--card); cursor: pointer; color: var(--ink); }
.era-toggle button.on { background: var(--forest); color: #fff; }
.decades { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 14px; position: sticky; top: 70px; background: var(--paper); z-index: 5; scrollbar-width: thin; }
.decades a { font: 14px/1 var(--head); padding: 8px 11px; border-radius: 8px; background: var(--paper-2); text-decoration: none; color: var(--ink); white-space: nowrap; }
.decades a:hover { background: var(--khaki); }
.tl { position: relative; margin: 10px 0 0; padding: 0; list-style: none; }
.tl::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: repeating-linear-gradient(180deg, var(--khaki-d) 0 10px, transparent 10px 18px); }
.tl-year { position: relative; text-align: center; margin: 26px 0 14px; scroll-margin-top: 140px; }
.tl-year span { position: relative; font: 500 20px/1 var(--head); background: var(--forest); color: #f5eedb; padding: 9px 18px; border-radius: 999px; box-shadow: 0 0 0 5px var(--paper); }
.tl-ev { position: relative; width: 50%; padding: 0 40px 18px 0; }
.tl-ev.r { margin-left: 50%; padding: 0 0 18px 40px; }
.tl-mark {
  position: absolute; top: 14px; right: -15px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--paper); color: var(--c); border: 2.5px solid var(--c); z-index: 1;
}
.tl-ev.r .tl-mark { left: -15px; right: auto; }
.tl-mark .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.tl-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tl-card .when { font: 14px/1.3 var(--head); color: var(--c); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-card h4 { font-size: 17px; margin: 4px 0; }
.tl-card p { font-size: 15px; color: var(--muted); margin: 0 0 6px; line-height: 1.6; }
.tl-card .note { font-size: 13.5px; color: var(--khaki-d); display: flex; gap: 6px; align-items: center; }
.tl-card .src { font-size: 13.5px; text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.scope-w { --c: var(--purple); }
.scope-t { --c: var(--c-skills); }
@media (max-width: 760px) {
  .tl::before { left: 15px; }
  .tl-year { text-align: left; }
  .tl-ev, .tl-ev.r { width: auto; margin-left: 0; padding: 0 0 16px 46px; }
  .tl-ev .tl-mark, .tl-ev.r .tl-mark { left: 0; right: auto; }
}

/* ค้นหา */
.big-search { position: relative; max-width: 720px; margin: 0 auto 26px; }
.big-search input { width: 100%; font: 19px var(--body); padding: 16px 22px 16px 54px; border-radius: 999px; border: 2px solid var(--khaki); background: var(--card); color: var(--ink); }
.big-search input:focus { outline: none; border-color: var(--forest-2); }
.big-search .ic { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--khaki-d); }
.res-group h3 { display: flex; gap: 8px; align-items: center; margin-top: 26px; }
.res { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; text-decoration: none; color: inherit; }
.res:hover { border-color: var(--khaki-d); }
.res small { color: var(--muted); font-family: var(--head); display: flex; gap: 6px; align-items: center; }
.res b { font-family: var(--head); font-weight: 500; display: block; }
.res p { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
mark { background: #f3dc8f; color: inherit; border-radius: 3px; padding: 0 2px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.empty .ic { width: 54px; height: 54px; color: var(--khaki); display: block; margin: 0 auto 10px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* หน้าแรก: เส้นเวลาย่อ */
.mini-tl { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 0; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.mini-ev { position: relative; padding: 34px 16px 0 0; }
.mini-ev::before { content: ''; position: absolute; top: 14px; left: 0; right: 0; border-top: 3px dashed var(--khaki-d); }
.mini-ev::after { content: ''; position: absolute; top: 6px; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px var(--paper); }
.mini-ev b { font: 500 24px/1 var(--head); color: var(--c); display: block; margin-bottom: 4px; }
.mini-ev span { font-size: 15px; line-height: 1.5; display: block; }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.about .sect { margin: 0; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }

footer { margin-top: 70px; background: var(--forest); color: #d9d0b6; padding: 34px 0; font-size: 15px; border-top: 4px solid var(--khaki); }
footer .wrap { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
footer b { color: #fff7e2; font-family: var(--head); font-weight: 500; }
footer .foot-note { text-align: right; line-height: 1.6; }
footer .foot-note small { display: block; margin-top: 6px; font-size: 13px; color: var(--khaki); }
footer .foot-note small:empty { display: none; }
@media (max-width: 760px) { footer .foot-note { text-align: left; } }

.loading { text-align: center; padding: 120px 0; color: var(--muted); }
.loading .ic { width: 48px; height: 48px; color: var(--khaki-d); animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ตัวอ่าน PDF */
.reader { background: #4a4a44; border-radius: var(--radius); }
.reader-bar {
  position: sticky; top: 70px; z-index: 6; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--forest); color: #f5eedb; padding: 10px 14px; border-radius: var(--radius) var(--radius) 0 0;
}
.reader-title { font: 500 15.5px/1.3 var(--head); display: flex; gap: 8px; align-items: center; min-width: 0; flex: 1 1 200px; }
.reader-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-page { font: 14px var(--head); color: var(--khaki); }
.reader-tools { display: flex; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid rgba(201,184,140,.5); background: transparent; color: inherit;
}
.icon-btn:hover { background: rgba(255,255,255,.1); }
.reader-pages { padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; overflow-x: auto; --zoom: 1; }
.rd-page { position: relative; width: min(100%, 900px); background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.35); flex: none; }
.reader-pages.zoomed { align-items: flex-start; }
.reader-pages.zoomed .rd-page { width: calc(min(100%, 900px) * var(--zoom)); }
.rd-page span { position: absolute; inset: 0; display: grid; place-items: center; color: #bbb; font: 28px var(--head); }
.rd-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.reader-frame { width: 100%; height: 80vh; border: 0; display: block; }
@media (max-width: 600px) { .reader-pages { padding: 8px; gap: 8px; } }

/* แชร์ */
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; font-size: 14.5px; }
.share-btn {
  font: 14.5px/1 var(--head); padding: 9px 14px; border-radius: 999px; cursor: pointer; text-decoration: none;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; gap: 6px; align-items: center;
}
.share-btn.line { background: #06c755; border-color: #06c755; color: #fff; }
.share-btn.fb { background: #1877f2; border-color: #1877f2; color: #fff; }

/* ฝึกทบทวน */
.practice { max-width: 760px; }
.practice-nav { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-top: 16px; }
.practice-nav .btn[disabled] { opacity: .4; cursor: default; }
.flash { display: block; width: 100%; height: 260px; perspective: 1200px; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.flash-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flash.flipped .flash-in { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 18px; padding: 24px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 8px;
}
.flash-face.front { background: var(--forest); color: #f5eedb; box-shadow: inset 0 0 0 6px var(--forest), inset 0 0 0 8px var(--khaki); }
.flash-face.back { background: var(--card); border: 2px solid var(--khaki); transform: rotateY(180deg); font-size: 18px; line-height: 1.6; overflow: auto; }
.flash-face small { font: 13.5px var(--head); opacity: .75; }
.flash-face b { font: 500 clamp(22px, 4vw, 30px)/1.3 var(--head); }
.flash-face em { font-style: normal; font-size: 14.5px; color: var(--khaki); display: flex; gap: 6px; align-items: center; }
.stepper .dots { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.dot { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--khaki); background: var(--card); font: 15px var(--head); cursor: pointer; color: var(--ink); }
.dot.done { background: var(--khaki); }
.dot.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.step-card { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--forest-2); border-radius: 0; padding: 22px 24px; min-height: 160px; }
.step-card small { font-family: var(--head); color: var(--khaki-d); }
.step-card p { margin: 0; font-size: 18px; }
.quiz { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.quiz-top { display: flex; justify-content: space-between; font-family: var(--head); color: var(--muted); }
.bar { height: 6px; background: var(--paper-2); border-radius: 6px; margin: 8px 0 16px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--forest-2); transition: width .3s; }
.opts { display: grid; gap: 10px; }
.opt {
  text-align: left; font: 16px/1.55 var(--body); padding: 12px 16px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
}
.opt:hover:not([disabled]) { border-color: var(--khaki-d); }
.opt.right { background: var(--forest-l); border-color: var(--c-skills); }
.opt.wrong { background: #f6e1dc; border-color: var(--c-safety); }
.opt[disabled] { cursor: default; }
.quiz-end { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 20px; }
.quiz-end .ic { width: 64px; height: 64px; color: var(--khaki-d); display: block; margin: 0 auto 8px; }
.quiz-end b { font: 500 40px/1 var(--head); display: block; margin-bottom: 8px; }

/* พิมพ์อินโฟกราฟิก A4 */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 11.5pt; line-height: 1.5; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .top, footer, .no-print, #reader, .crumbs, .pager, .sec-head p { display: none !important; }
  .print-only { display: flex !important; }
  .page-head { background: #fff; border: 0; }
  .page-head .wrap, .wrap { padding: 0; max-width: none; }
  .book-hero { grid-template-columns: 38mm 1fr; gap: 8mm; }
  .book-hero h1 { font-size: 22pt; margin-top: 4px; }
  .book-hero .summary { font-size: 11.5pt; }
  .sec { padding: 6mm 0 0; }
  .sec-head { margin-bottom: 3mm; }
  .sec-head h2 { font-size: 14pt; }
  .highlights { grid-template-columns: repeat(4, 1fr); gap: 3mm; }
  .hl { padding: 3mm 4mm; break-inside: avoid; }
  .hl b { font-size: 15pt; }
  .hl span { font-size: 9.5pt; }
  .sections { columns: 2; column-gap: 5mm; }
  .sect { padding: 3mm 4mm; margin-bottom: 4mm; }
  .sect h3 { font-size: 11.5pt; }
  .sect h3 .ic { width: 22px; height: 22px; padding: 3px; }
  .sect li { font-size: 10pt; margin-bottom: 2px; line-height: 1.45; }
  .step { padding: 0 0 3mm 12mm; break-inside: avoid; }
  .step::before { width: 8mm; height: 8mm; font-size: 10pt; }
  .step::after { left: 4mm; top: 8mm; }
  .step p { font-size: 10pt; }
  .glossary { grid-template-columns: repeat(3, 1fr); gap: 2mm; }
  .term { padding: 2mm 3mm; break-inside: avoid; }
  .term p { font-size: 9pt; }
  .tl::before { left: 10px; }
  .tl-ev, .tl-ev.r { width: auto; margin: 0; padding: 0 0 2mm 30px; break-inside: avoid; }
  .tl-ev .tl-mark, .tl-ev.r .tl-mark { left: 0; width: 20px; height: 20px; }
  .tl-card { padding: 2mm 3mm; box-shadow: none; }
  .tl-card p, .tl-card .src { font-size: 9pt; }
  .quote { font-size: 13pt; padding: 4mm; }
  .print-foot { gap: 6mm; align-items: center; border-top: 2px solid var(--khaki); margin-top: 6mm; padding-top: 4mm; font-size: 10pt; break-inside: avoid; }
  .print-foot .qr { width: 110px; flex: none; }
  .print-foot span { color: var(--muted); }
}
