/* ============================================================
   ต่อยอด AI | TORYOD AI — ธีมงานผ้าสักหลาดคราฟต์บนกระดาษครีม
   แก้สีทั้งเว็บได้ที่ :root ด้านล่างนี้
   ============================================================ */
:root {
  --paper: #FBEEDB;      /* พื้นกระดาษครีม */
  --card: #FFF8EE;       /* การ์ด */
  --cream: #FFF1DC;      /* ตัวอักษรบนผ้ากรมท่า */
  --navy: #1F2544;       /* ผ้าสักหลาดกรมท่า + ตัวอักษรหลัก */
  --navy-deep: #0E1A36;
  --stitch: #E8792B;     /* ตะเข็บส้ม */
  --orange: #F06A24;     /* สีแบรนด์ */
  --leaf: #5E8A2E;
  --gold: #EEB23A;
  --ink: #1F2544;
  --ink-soft: #4B5070;
  --line: #E6D3B5;

  --shadow-hard: 3px 3px 0 var(--navy);
  --shadow-soft: 0 6px 16px rgba(31, 37, 68, .14);

  --f-display: "Kanit", "Bai Jamjuree", system-ui, sans-serif;
  --f-head: "Bai Jamjuree", "Kanit", system-ui, sans-serif;
  --f-body: "Anuphan", "Bai Jamjuree", system-ui, sans-serif;
  --f-hand: "Sriracha", "Anuphan", cursive;
  --f-mono: "IBM Plex Mono", "Anuphan", ui-monospace, Consolas, monospace;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .18 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper) var(--grain);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--navy); color: var(--cream); padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 8px; }
.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- ปุ่ม: เงาแข็งแบบสติกเกอร์ ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 8px 22px;
  border: 2px solid var(--navy); border-radius: 999px;
  background: var(--card); color: var(--navy);
  font-family: var(--f-head); font-weight: 700; font-size: 1.0625rem; line-height: 1.3;
  text-decoration: none; text-align: center; cursor: pointer;
  box-shadow: var(--shadow-hard);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--navy); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--navy); }
.btn--primary { background: var(--orange); }
.btn--primary::after {              /* ตะเข็บด้านในปุ่ม */
  content: ""; position: absolute; inset: 4px; pointer-events: none;
  border: 1.5px dashed rgba(255, 241, 220, .9); border-radius: inherit;
}
.btn--lg { min-height: 58px; padding: 10px 32px; font-size: 1.25rem; }
.btn--sm { padding: 6px 16px; font-size: 1rem; box-shadow: 2px 2px 0 var(--navy); }
.btn--onfelt { background: transparent; color: var(--cream); border-color: var(--cream); box-shadow: none; }
.btn--onfelt:hover, .btn--onfelt:active { box-shadow: none; }

.btn--cart .btn--cart__on { display: none; }
.btn--cart span { display: inline-flex; align-items: center; gap: 6px; }
.btn--cart[aria-pressed="true"] { background: var(--navy); color: var(--cream); }
.btn--cart[aria-pressed="true"] .btn--cart__on { display: inline-flex; }
.btn--cart[aria-pressed="true"] .btn--cart__off { display: none; }

/* ---------- แถบบนสุด ---------- */
.top { background: var(--paper) var(--grain); border-bottom: 2px solid var(--navy); z-index: 50; }
.top__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; padding-block: 8px 0; }
.top__nav { order: 3; width: 100%; display: flex; justify-content: space-between; margin-top: 8px; border-top: 2px dashed var(--line); }
.top__nav a {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 6px;
  font-family: var(--f-head); font-weight: 700; font-size: 1rem; text-decoration: none;
}
.top__nav a:hover { text-decoration: underline; text-decoration-color: var(--stitch); text-decoration-thickness: 3px; text-underline-offset: 6px; }

.logo { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--navy); font-family: var(--f-display); font-weight: 700; line-height: 1; }
.logo__mark { width: 36px; height: 36px; flex: none; }
.logo__th { font-size: 1.35rem; }
.logo__ai { background: var(--orange); border-radius: 7px; padding: 4px 7px 3px; font-size: 1.15rem; margin-left: -2px; }
.logo__bar, .logo__en { display: none; }
.logo__bar { width: 2px; height: 24px; background: var(--navy); margin-inline: 5px; }
.logo__en { font-size: 1.2rem; letter-spacing: .03em; }

@media (min-width: 560px) {
  .logo__bar { display: block; }
  .logo__en { display: inline; }
}
@media (min-width: 900px) {
  .top { position: sticky; top: 0; }
  .top__row { flex-wrap: nowrap; padding-block: 10px; }
  .top__nav { order: 0; width: auto; margin: 0 0 0 auto; border: 0; gap: 14px; }
  .top__nav a { padding: 0 8px; }
  .logo__mark { width: 40px; height: 40px; }
}

/* ---------- Hero (เลียนแบบปก Facebook) ---------- */
.hero { position: relative; overflow: hidden; padding: 30px 0 44px; text-align: center; }
.hero::before {                    /* มุมผ้าสักหลาดกรมท่า ตะเข็บส้ม */
  content: ""; position: absolute; left: -92px; top: -104px; width: 170px; height: 170px;
  border-radius: 50%; background: var(--navy); outline: 2px dashed var(--stitch); outline-offset: -10px;
}
.hero__in {
  position: relative; display: grid; justify-items: center;
  grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr);
  grid-template-areas:
    "title title title title"
    "sub sub sub sub"
    "stage stage stage stage"
    ". mascot tag ."
    "actions actions actions actions"
    "facts facts facts facts";
}
.hero__title { grid-area: title; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--f-display); font-style: italic; font-weight: 800; }
.hero__lead { font-size: clamp(2.6rem, 12.5vw, 4.3rem); line-height: 1.2; color: var(--navy); }
.hero__pill {
  position: relative; display: inline-block;
  padding: .1em .55em .14em; border-radius: .55em;
  background: var(--orange); color: var(--navy); border: 2px solid var(--navy);
  box-shadow: var(--shadow-hard);
  font-size: clamp(1.7rem, 8.2vw, 3.6rem); line-height: 1.3; transform: rotate(-2deg);
}
.hero__pill::after { content: ""; position: absolute; inset: 5px; border: 2px dashed rgba(255, 241, 220, .9); border-radius: .42em; pointer-events: none; }
.hero__sprout { position: absolute; right: -14px; top: -24px; width: 34px; height: auto; transform: rotate(18deg); }
.hero__sub { grid-area: sub; max-width: 36em; margin: 22px 0 0; color: var(--ink-soft); }

/* เวที: หนังสือ 5 เล่ม */
.stage { grid-area: stage; position: relative; margin-top: 30px; }
.shelf {
  --bw: clamp(84px, 27vw, 124px);
  --ov: calc(var(--bw) * -.44);
  list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; justify-content: center;
}
.shelf__book { position: relative; flex: none; width: var(--bw); margin-left: var(--ov); transform-origin: bottom center; }
.shelf__book:first-child { margin-left: 0; }
.shelf__book img, .book {
  display: block; width: 100%; border-radius: 2px 5px 5px 2px;
  /* ขอบหน้ากระดาษด้านขวา + เงานุ่ม */
  box-shadow: 2px 0 0 #FFF8EE, 3px 0 0 #D8C6A6, 5px 0 0 #FFF8EE, 6px 0 0 #D8C6A6, 0 6px 16px rgba(31, 37, 68, .14);
}
.shelf__book:nth-child(1) { z-index: 1; transform: perspective(800px) rotateY(16deg) scale(.9); }
.shelf__book:nth-child(2) { z-index: 2; transform: perspective(800px) rotateY(8deg); }
.shelf__book:nth-child(3) { z-index: 3; transform: scale(1.1); }
.shelf__book:nth-child(4) { z-index: 2; transform: perspective(800px) rotateY(-8deg); }
.shelf__book:nth-child(5) { z-index: 1; transform: perspective(800px) rotateY(-16deg) scale(.9); }

/* มาสคอต: บนมือถือยืนข้างป้ายราคา บนจอคอมยืนข้างหนังสือ (เหมือนปก Facebook) */
.hero__mascot { grid-area: mascot; align-self: end; width: clamp(84px, 25vw, 112px); height: auto; margin: 22px 6px -4px 0; filter: drop-shadow(0 6px 8px rgba(31, 37, 68, .14)); }

/* กระดาษโน้ตติดเทป (ลายมือ) */
.note {
  position: relative; margin: 0; padding: 18px 16px 14px; width: 168px;
  background: var(--card); box-shadow: var(--shadow-soft);
  font-family: var(--f-hand); font-size: 1.1rem; line-height: 1.45; color: var(--navy); text-align: center;
}
.note::before { content: ""; position: absolute; left: 50%; top: -10px; width: 62px; height: 20px; margin-left: -31px; background: #E9C99A; opacity: .9; transform: rotate(-3deg); }
.stage__note { display: none; }

.pricetag {
  grid-area: tag; align-self: end; justify-self: start;
  margin: 0; display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 12px;
  padding: 6px 16px; background: var(--card); color: var(--navy); border: 2px solid var(--gold); border-radius: 24px;
  box-shadow: var(--shadow-hard); font-family: var(--f-head); font-weight: 700; line-height: 1.3;
}
.pricetag__was { color: var(--ink-soft); text-decoration-thickness: 2px; }
.pricetag__now { font-family: var(--f-display); font-style: italic; font-weight: 800; font-size: 2rem; }
.pricetag__off { background: var(--navy); color: var(--cream); padding: 1px 12px; border-radius: 999px; }
.hero__actions { grid-area: actions; margin-top: 20px; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 380px; }
.hero__facts { grid-area: facts; list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; color: var(--ink-soft); font-size: 1rem; }
.hero__facts li { display: inline-flex; align-items: center; gap: 6px; }
.hero__facts .icon { color: var(--leaf); }

@media (min-width: 600px) {
  .hero__actions { flex-direction: row; justify-content: center; max-width: none; }
}
@media (min-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero::before { left: -110px; top: -120px; width: 260px; height: 260px; }
  .hero__in {
    grid-template-areas:
      "title title title title"
      "sub sub sub sub"
      ". mascot stage ."
      "tag tag tag tag"
      "actions actions actions actions"
      "facts facts facts facts";
  }
  .hero__title { flex-direction: row; justify-content: center; gap: 20px; }
  .hero__sprout { width: 54px; top: -42px; right: 22px; transform: rotate(14deg); }
  .hero__sub { font-size: 1.2rem; }
  .stage { margin-top: 44px; }
  .shelf { --bw: clamp(118px, 13.4vw, 158px); --ov: 16px; }
  .shelf__book:nth-child(n) { transform: none; z-index: 1; }
  .hero__mascot { width: clamp(120px, 15vw, 170px); margin: 0 20px -10px 0; }
  .pricetag { padding: 6px 22px; border-radius: 999px; }
  .hero .pricetag { justify-self: center; margin-top: 40px; }
}
@media (min-width: 1100px) {
  .stage__note { display: block; position: absolute; right: -52px; top: -92px; transform: rotate(5deg); z-index: 4; }
}

/* ---------- หัวข้อ section ---------- */
.section { padding: 56px 0; }
.section--band { background: #F6E2C4 var(--grain); }   /* แถบกระดาษเข้มขึ้นนิดหนึ่ง สลับจังหวะหน้า */
.section--last { padding-bottom: 64px; }
.section__cta { margin: 44px 0 0; text-align: center; }
.wrap--narrow { max-width: 820px; }
.is-todo { color: var(--ink-soft); font-style: italic; }
.link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-family: var(--f-head); font-weight: 700; text-decoration-color: var(--stitch); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.hand { margin: 30px 0 0; text-align: center; font-family: var(--f-hand); font-size: 1.5rem; line-height: 1.4; }
@media (min-width: 900px) { .section { padding: 76px 0; } }
.section > .wrap > .ribbon, .section > .wrap > .h2, .section > .wrap > .lead { display: block; text-align: center; margin-inline: auto; }
.ribbon {                           /* ป้ายผ้าริบบิ้นกรมท่า ตะเข็บส้ม */
  position: relative; width: fit-content; margin: 0; padding: 6px 20px;
  background: var(--navy); color: var(--cream); border-radius: 999px;
  font-family: var(--f-head); font-weight: 700; font-size: 1rem; line-height: 1.4;
}
.ribbon::after { content: ""; position: absolute; inset: 3px; border: 1.5px dashed var(--stitch); border-radius: inherit; pointer-events: none; }
.h2 { margin: 14px 0 8px; font-family: var(--f-display); font-style: italic; font-weight: 800; font-size: clamp(1.8rem, 6.4vw, 2.7rem); line-height: 1.3; text-wrap: balance; }
.lead { margin: 0; max-width: 40em; color: var(--ink-soft); }

/* ---------- การ์ดหนังสือ ---------- */
.bookgrid { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.bookcard {
  flex: 1 1 300px; max-width: 340px; overflow: hidden;
  display: grid; grid-template-columns: 112px 1fr; column-gap: 14px; align-content: start;
  background: var(--card); border: 2px solid var(--navy); border-radius: 18px; box-shadow: var(--shadow-hard);
}
.bookcard::before {                 /* แถบผ้าสีประจำเล่ม มีตะเข็บ */
  content: ""; grid-column: 1 / -1; height: 14px; border-bottom: 2px solid var(--navy);
  background: repeating-linear-gradient(90deg, rgba(255, 248, 238, .95) 0 8px, transparent 8px 15px) center / 100% 2px no-repeat, var(--bc);
}
.bookcard__cover { padding: 16px 0 0 16px; }
.bookcard__head { padding: 16px 16px 0 0; min-width: 0; }
.bookcard__body { grid-column: 1 / -1; padding: 14px 16px 16px; }
.tag {
  display: inline-block; margin: 0; padding: 1px 12px; border: 2px solid var(--bc); border-radius: 999px;
  background: #FFFDF8; color: var(--bct); font-family: var(--f-head); font-weight: 700; font-size: 1rem; line-height: 1.5;
}
.bookcard__title { margin: 8px 0 4px; font-family: var(--f-head); font-weight: 700; font-size: 1.2rem; line-height: 1.4; text-wrap: balance; }
.bookcard__sub { margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.5; }
.bookcard__mini { margin: 0 0 6px; color: var(--bct); font-family: var(--f-head); font-weight: 700; font-size: 1rem; }
.outcomes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.outcomes li { display: flex; align-items: flex-start; gap: 8px; font-size: 1rem; line-height: 1.6; }
.outcomes .icon { color: var(--bct); margin-top: .2em; }
.outcomes .is-todo span { color: var(--ink-soft); font-style: italic; }
.bookcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--line); }
.price { margin: 0; font-family: var(--f-display); font-style: italic; font-weight: 800; font-size: 1.8rem; line-height: 1; }

@media (min-width: 700px) {
  .bookcard { display: flex; flex-direction: column; }
  .bookcard::before { flex: none; }
  .bookcard__cover { padding: 22px 0 20px; background: color-mix(in srgb, var(--bc) 15%, var(--card)); }
  .bookcard__cover .book { width: 190px; margin-inline: auto; }
  .bookcard__head { padding: 16px 20px 0; }
  .bookcard__body { flex: 1; display: flex; flex-direction: column; padding: 14px 20px 20px; }
  .bookcard__foot { margin-top: auto; }
  .outcomes { margin-bottom: 16px; }
}

/* ---------- แผ่นผ้าสักหลาดกรมท่า ตะเข็บส้ม ---------- */
.felt { position: relative; background: var(--navy) var(--grain); color: var(--cream); border-radius: 22px; box-shadow: var(--shadow-soft); }
.felt::after { content: ""; position: absolute; inset: 8px; border: 2px dashed var(--stitch); border-radius: 15px; pointer-events: none; }
.felt :focus-visible { outline-color: var(--cream); }

.felt .btn--primary { border-color: var(--navy-deep); box-shadow: 3px 3px 0 var(--navy-deep); }
[hidden] { display: none !important; }

/* ---------- 3. ปัญหาที่คนเจอ: กระดาษโน้ตติดเทป ---------- */
.pnotes { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 32px; }
.pnote { position: relative; padding: 28px 20px 20px; background: var(--card); box-shadow: var(--shadow-soft); }
.pnote::before { content: ""; position: absolute; left: 50%; top: -11px; width: 74px; height: 22px; margin-left: -37px; background: #E9C99A; opacity: .9; transform: rotate(-3deg); }
.pnote:nth-child(odd) { transform: rotate(-1deg); }
.pnote:nth-child(even) { transform: rotate(.8deg); }
.pnote:nth-child(even)::before { transform: rotate(2deg); }
.pnote__title { margin: 0 0 6px; font-family: var(--f-head); font-weight: 700; font-size: 1.25rem; line-height: 1.4; }
.pnote p { margin: 0; }
@media (min-width: 800px) { .pnotes { grid-template-columns: repeat(3, 1fr); gap: 28px; } }

/* ---------- 4. เส้นทาง 5 ขั้น ---------- */
.path { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 28px; }
.path li { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 14px; align-items: center; }
.path__step {
  position: relative; margin: 0; padding: 14px 6px; border-radius: 14px; text-align: center;
  background: var(--navy) var(--grain); color: var(--cream);
  font-family: var(--f-display); font-style: italic; font-weight: 800; font-size: 1.15rem; line-height: 1.3;
}
.path__step::after { content: ""; position: absolute; inset: 4px; border: 1.5px dashed var(--stitch); border-radius: 10px; pointer-events: none; }
.path li + li .path__step::before {   /* ลูกศร › สีส้ม */
  content: "\203A"; position: absolute; left: 50%; top: -28px; transform: translateX(-50%) rotate(90deg);
  color: var(--orange); font-style: normal; font-size: 1.7rem; line-height: 1;
}
.path__in { display: flex; align-items: center; gap: 14px; transition: opacity .15s; }
.path__step { transition: opacity .15s; }
.path__thumb { width: 52px; flex: none; }
.path__text { margin: 0; font-size: 1rem; line-height: 1.5; }
.path__label { display: block; color: var(--bct); font-family: var(--f-head); font-weight: 700; }
.path__gone { display: none; margin: 4px 0 0; color: #9A3412; font-family: var(--f-head); font-weight: 700; font-size: 1rem; line-height: 1.4; }
.path li.is-out .path__step, .path li.is-out .path__in { opacity: .32; }
.path li.is-out .path__gone { display: block; }

@media (min-width: 900px) {
  .path { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: auto auto; gap: 0; }
  .path::before { content: ""; grid-row: 1; grid-column: 1 / -1; background: var(--navy) var(--grain); border-radius: 999px; box-shadow: var(--shadow-soft); }
  .path::after { content: ""; grid-row: 1; grid-column: 1 / -1; margin: 7px; border: 2px dashed var(--stitch); border-radius: 999px; pointer-events: none; z-index: 2; }
  .path li { display: contents; }
  .path li:nth-child(1) > * { grid-column: 1; }
  .path li:nth-child(2) > * { grid-column: 2; }
  .path li:nth-child(3) > * { grid-column: 3; }
  .path li:nth-child(4) > * { grid-column: 4; }
  .path li:nth-child(5) > * { grid-column: 5; }
  .path__step { grid-row: 1; z-index: 1; padding: 22px 8px; background: none; border-radius: 0; font-size: 1.5rem; }
  .path__step::after { display: none; }
  .path li + li .path__step::before { left: -5px; top: 50%; transform: translateY(-54%); font-size: 2.1rem; }
  .path__book { grid-row: 2; padding: 26px 12px 0; text-align: center; }
  .path__in { flex-direction: column; gap: 12px; }
  .path__thumb { width: 96px; }
}

/* ---------- 6. ตัวคำนวณชุดคุ้ม ---------- */
.calc { margin-top: 36px; display: grid; gap: 24px; }
.calc__pick { margin: 0; min-width: 0; padding: 8px 14px 16px; background: var(--card); border: 2px solid var(--navy); border-radius: 18px; box-shadow: var(--shadow-hard); }
.calc__pick legend { padding: 0 8px; font-family: var(--f-head); font-weight: 700; font-size: 1.15rem; }
.pick { position: relative; display: grid; grid-template-columns: 30px 42px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 2px dashed var(--line); cursor: pointer; }
.pick input { position: absolute; left: 4px; top: 50%; width: 30px; height: 30px; margin: -15px 0 0; opacity: 0; cursor: pointer; }
.pick__box { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--navy); border-radius: 9px; background: #FFFDF8; color: transparent; }
.pick input:checked + .pick__box { background: var(--navy); color: var(--cream); }
.pick input:focus-visible + .pick__box { outline: 3px solid var(--navy); outline-offset: 3px; }
.pick__thumb { width: 42px; border-radius: 2px 4px 4px 2px; transition: opacity .15s, filter .15s; }
.pick input:not(:checked) ~ .pick__thumb { opacity: .45; filter: grayscale(.6); }
.pick__text { display: block; min-width: 0; }
.pick__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pick__label { color: var(--bct); font-family: var(--f-head); font-weight: 700; font-size: 1rem; }
.pick__price { font-family: var(--f-head); font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.pick__title { display: block; font-size: 1rem; line-height: 1.45; }
.calc__all { width: 100%; margin-top: 16px; }
.calc__all span { display: inline-flex; align-items: center; gap: 6px; }
.calc__all[aria-disabled="true"] { background: var(--navy); color: var(--cream); box-shadow: none; transform: none; cursor: default; }

.calc__result { padding: 30px 24px 28px; display: flex; flex-direction: column; gap: 14px; }
.calc__count { margin: 0; font-family: var(--f-display); font-style: italic; font-weight: 800; font-size: 1.6rem; line-height: 1.2; }
.tiers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.tiers li { display: grid; gap: 4px; }
.tiers__p { padding: 7px 0; border: 2px solid rgba(255, 241, 220, .35); border-radius: 10px; color: #C8CBDD; font-family: var(--f-head); font-weight: 700; font-size: 1rem; line-height: 1.2; white-space: nowrap; }
.tiers__n { color: #C8CBDD; font-size: 1rem; line-height: 1.3; white-space: nowrap; }
.tiers li.is-on .tiers__p { background: var(--cream); border-color: var(--cream); color: var(--navy); }
.tiers li.is-now .tiers__p { background: var(--orange); border-color: var(--orange); color: var(--navy); }
.tiers li.is-now .tiers__n { color: var(--cream); font-weight: 600; }
.sum { margin: 4px 0 0; display: grid; gap: 4px; }
.sum div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sum dd { margin: 0; font-family: var(--f-head); font-weight: 700; font-size: 1.15rem; }
.sum__total { margin-top: 6px; padding-top: 10px; border-top: 2px dashed var(--stitch); }
.sum__total dt { font-family: var(--f-head); font-weight: 700; font-size: 1.2rem; }
.sum .sum__total dd { font-family: var(--f-display); font-style: italic; font-size: 2.9rem; font-weight: 800; line-height: 1.1; }
.saved { align-self: flex-start; margin: 0; padding: 1px 14px; background: var(--cream); color: var(--navy); border-radius: 999px; font-family: var(--f-head); font-weight: 700; }
.nudge { margin: 0; color: #FFE2BD; min-height: 3.4em; }
.calc__pay { width: 100%; }
.calc__msg { margin: 0; font-size: 1rem; line-height: 1.5; }
.calc__msg:empty { display: none; }
@media (min-width: 900px) {
  .calc { grid-template-columns: minmax(0, 1fr) 440px; align-items: start; gap: 28px; }
  .calc__pick { padding: 10px 22px 22px; }
  .calc__result { padding: 34px 32px 32px; }
}

/* ---------- 7. ตารางเทียบความคุ้ม ---------- */
.cmp { position: relative; max-width: 720px; margin: 36px auto 0; background: var(--card); border: 2px solid var(--navy); border-radius: 18px; box-shadow: var(--shadow-hard); }
.cmp table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.cmp th, .cmp td { padding: 12px 10px; text-align: right; white-space: nowrap; line-height: 1.4; }
.cmp th:first-child { padding-left: 16px; text-align: left; }
.cmp td:last-child, .cmp thead th:last-child { padding-right: 16px; }
.cmp thead th { background: var(--navy); color: var(--cream); font-family: var(--f-head); font-weight: 700; }
.cmp thead th:first-child { border-radius: 15px 0 0 0; }
.cmp thead th:last-child { border-radius: 0 15px 0 0; }
.cmp tbody tr + tr { border-top: 2px dashed var(--line); }
.cmp tbody th { font-family: var(--f-head); font-weight: 700; }
.cmp__off { display: block; width: fit-content; margin-top: 2px; padding: 0 9px; border-radius: 999px; background: var(--paper); color: var(--ink-soft); font-size: 1rem; }
.cmp tr.is-best th, .cmp tr.is-best td { background: #FFEFC9; padding-top: 14px; padding-bottom: 30px; }
.cmp tr.is-best th { border-radius: 0 0 0 15px; font-size: 1.15rem; }
.cmp tr.is-best td:last-child { border-radius: 0 0 15px 0; }
.cmp tr.is-best td { font-family: var(--f-display); font-style: italic; font-weight: 800; font-size: 1.5rem; }
.cmp tr.is-best .cmp__off { background: var(--navy); color: var(--cream); }
.cmp__flag {
  position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%); margin: 0; padding: 3px 18px; white-space: nowrap;
  background: var(--gold); color: var(--navy); border: 2px solid var(--navy); border-radius: 999px; box-shadow: 2px 2px 0 var(--navy);
  font-family: var(--f-head); font-weight: 700;
}
@media (min-width: 640px) {
  .cmp th, .cmp td { padding: 14px 22px; }
  .cmp th:first-child { padding-left: 26px; }
  .cmp td:last-child, .cmp thead th:last-child { padding-right: 26px; }
  .cmp__off { display: inline-block; margin: 0 0 0 8px; }
}

/* ---------- 8. ข้างในเล่ม ---------- */
.inside { margin-top: 36px; display: grid; gap: 28px; }
.samples { list-style: none; margin: 0; padding: 4px 4px 14px; display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; }
.samples li { flex: 0 0 58%; scroll-snap-align: start; }
.sample { display: block; width: 100%; aspect-ratio: 1055 / 1491; object-fit: cover; border-radius: 6px; box-shadow: var(--shadow-soft); }
.sample--todo { display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; background: var(--card); border: 2px dashed #9A9DB3; box-shadow: none; color: var(--ink-soft); font-size: 1rem; line-height: 1.5; }
.sample--todo .icon { width: 32px; height: 32px; }
.prompt { overflow: hidden; background: #FFFDF8; border: 2px solid var(--navy); border-radius: 16px; box-shadow: var(--shadow-hard); }
.prompt__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 18px; background: var(--navy); color: var(--cream); }
.prompt__title { margin: 0; font-family: var(--f-head); font-weight: 700; }
.prompt__copy { box-shadow: 2px 2px 0 var(--navy-deep); }
.prompt__copy span { display: inline-flex; align-items: center; gap: 6px; }
.prompt__text { margin: 0; padding: 18px; font-family: var(--f-mono); font-size: 1rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 800px) {
  .inside { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .samples { padding: 0; overflow: visible; }
  .samples li { flex: 1 1 0; }
}

/* ---------- 9. ได้อะไรบ้าง ---------- */
.incs { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 16px; }
.inc { display: flex; align-items: flex-start; gap: 14px; padding: 18px; background: var(--card); border: 2px solid var(--navy); border-radius: 16px; box-shadow: var(--shadow-hard); }
.inc__icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--navy); color: var(--cream); }
.inc__icon .icon { width: 26px; height: 26px; }
.inc__title { margin: 0 0 2px; font-family: var(--f-head); font-weight: 700; font-size: 1.15rem; line-height: 1.4; }
.inc p { margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.6; }
@media (min-width: 640px) { .incs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .incs { grid-template-columns: repeat(4, 1fr); } .inc { flex-direction: column; } }

/* ---------- 10. เหมาะกับใคร ---------- */
.fits { margin-top: 36px; display: grid; gap: 20px; }
.fit { padding: 22px 20px; border-radius: 18px; }
.fit--yes { background: var(--card); border: 2px solid var(--navy); box-shadow: var(--shadow-hard); }
.fit--no { border: 2px dashed #9A9DB3; }
.fit__title { margin: 0 0 10px; font-family: var(--f-head); font-weight: 700; font-size: 1.25rem; }
.fit ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fit li { display: flex; align-items: flex-start; gap: 10px; }
.fit .icon { margin-top: .25em; }
.fit--yes .icon { color: var(--leaf); }
.fit--no .icon { color: var(--ink-soft); }
@media (min-width: 800px) { .fits { grid-template-columns: 1fr 1fr; } .fit { padding: 28px; } }

/* ---------- 11. ผู้เขียน ---------- */
.author { max-width: 760px; margin: 36px auto 0; padding: 24px 20px; display: grid; gap: 18px; justify-items: center; text-align: center; background: var(--card); border: 2px solid var(--navy); border-radius: 18px; box-shadow: var(--shadow-hard); }
.author__photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 2px solid var(--navy); }
.author__photo--todo { display: grid; place-content: center; justify-items: center; border: 2px dashed #9A9DB3; color: var(--ink-soft); font-size: 1rem; }
.author__name { margin: 0; font-family: var(--f-head); font-weight: 700; font-size: 1.3rem; }
.author__role { margin: 0 0 8px; color: var(--ink-soft); }
.author p:last-child { margin: 0; }
@media (min-width: 700px) { .author { grid-template-columns: auto 1fr; justify-items: start; align-items: center; gap: 28px; padding: 28px 32px; text-align: left; } }

/* ---------- 12. รีวิว ---------- */
.reviews { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 20px; }
.review { padding: 20px; background: var(--card); box-shadow: var(--shadow-soft); }
.review__text { margin: 0 0 10px; }
.review__by { margin: 0; font-family: var(--f-head); font-weight: 700; }
@media (min-width: 800px) { .reviews { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 13. FAQ ---------- */
.qas { margin-top: 36px; display: grid; gap: 12px; }
.qa { background: var(--card); border: 2px solid var(--navy); border-radius: 14px; }
.qa summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 10px 16px; cursor: pointer; list-style: none; font-family: var(--f-head); font-weight: 700; font-size: 1.1rem; line-height: 1.45; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary:focus-visible { border-radius: 12px; }
.qa summary .icon { transition: transform .15s; }
.qa[open] summary .icon { transform: rotate(45deg); }
.qa p { margin: 0; padding: 0 16px 16px; }

/* สารบัญในการ์ดหนังสือ (โชว์เมื่อใส่ toc ใน books.json) */
.toc { margin-top: 10px; }
.toc summary { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; list-style: none; color: var(--bct); font-family: var(--f-head); font-weight: 700; }
.toc summary::-webkit-details-marker { display: none; }
.toc[open] summary .icon { transform: rotate(45deg); }
.toc ol { margin: 0; padding-left: 1.4em; font-size: 1rem; line-height: 1.6; }

/* ---------- 14. ปิดการขาย ---------- */
.closing { padding: 54px 22px 34px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.closing__title { margin: 8px 0 0; font-family: var(--f-display); font-style: italic; font-weight: 800; font-size: clamp(1.9rem, 7vw, 2.8rem); line-height: 1.25; }
.closing__price { display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.closing__mascot { width: 96px; height: auto; margin-bottom: -4px; }
.closing .pricetag { box-shadow: 3px 3px 0 var(--navy-deep); }
.closing__alt { display: inline-flex; align-items: center; min-height: 44px; color: var(--cream); text-underline-offset: 4px; }
@media (min-width: 900px) { .closing { padding: 56px 40px 44px; } .closing__mascot { width: 112px; } }

/* ---------- หน้าหลังชำระเงิน (ขอบคุณ / ยกเลิก) ---------- */
.after { text-align: center; min-height: 60vh; }
.after .ribbon { margin-inline: auto; }
.after .lead { margin-inline: auto; }
.after__mascot { display: block; width: 150px; height: auto; margin: 0 auto 18px; }
.receipt { max-width: 560px; margin: 28px auto 0; padding: 22px 20px; text-align: left; background: var(--card); border: 2px solid var(--navy); border-radius: 18px; box-shadow: var(--shadow-hard); }
.receipt__title, .after__h { margin: 0 0 10px; font-family: var(--f-head); font-weight: 700; font-size: 1.2rem; }
.receipt__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.receipt__list li { padding-bottom: 10px; border-bottom: 2px dashed var(--line); line-height: 1.5; }
.receipt__label { display: block; color: var(--ink-soft); font-family: var(--f-head); font-weight: 700; font-size: 1rem; }
.receipt__total { margin: 14px 0 0; display: flex; align-items: baseline; justify-content: space-between; font-family: var(--f-head); font-weight: 700; }
.receipt__total strong { font-family: var(--f-display); font-style: italic; font-weight: 800; font-size: 2rem; line-height: 1.1; }
.after__next { max-width: 560px; margin: 28px auto 0; text-align: left; }
.after__next p { margin: 0 0 8px; }
.after__actions { margin: 32px 0 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 22px; }

/* ---------- หน้าเงื่อนไขและนโยบาย ---------- */
.policy .ribbon { margin-inline: auto; }
.policy h1 { text-align: center; }
.policy__date { margin: 0; text-align: center; color: var(--ink-soft); }
.policy__nav { margin: 14px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; }
.policy__part { margin-top: 48px; scroll-margin-top: 90px; }
.policy__part > .h2 { font-size: clamp(1.6rem, 5.4vw, 2.1rem); }
.policy__sec { margin-top: 22px; padding: 18px 20px; background: var(--card); border: 2px solid var(--navy); border-radius: 14px; }
.policy__sec h3 { margin: 0 0 6px; font-family: var(--f-head); font-weight: 700; font-size: 1.15rem; line-height: 1.4; }
.policy__sec p { margin: 0 0 8px; }
.policy__sec p:last-child, .policy__sec ul:last-child { margin-bottom: 0; }
.policy__sec ul { margin: 0 0 8px; padding-left: 1.3em; }
.policy__sec li { margin-bottom: 4px; }

/* ปุ่มระหว่างกำลังไปหน้าชำระเงิน */
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* ---------- 16. แถบติดขอบล่าง (มือถือ) ---------- */
.paybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--navy) var(--grain); color: var(--cream); border-top: 2px solid var(--navy-deep);
}
.paybar::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; border-top: 2px dashed var(--stitch); }
.paybar__text { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-family: var(--f-head); font-weight: 700; line-height: 1.3; }
.paybar__pay::before { content: "\00B7\00A0"; }
.paybar__pay strong { font-family: var(--f-display); font-style: italic; font-weight: 800; font-size: 1.45rem; }
.paybar .btn { flex: none; padding-inline: 24px; border-color: var(--navy-deep); box-shadow: 2px 2px 0 var(--navy-deep); }
.paybar :focus-visible { outline-color: var(--cream); }
body:has(.paybar) { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .paybar { display: none; }
  body:has(.paybar) { padding-bottom: 0; }
}

/* ---------- ท้ายเว็บ ---------- */
.foot { position: relative; background: var(--navy-deep); color: var(--cream); padding: 40px 0 30px; }
.foot__points {                     /* แถบริบบิ้น 4 ข้อ (เหมือนแถบล่างของปก Facebook) */
  list-style: none; margin: 0 0 22px; padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; text-align: center;
  background: var(--navy) var(--grain); border: 2px dashed var(--stitch); border-radius: 20px; font-family: var(--f-head); font-weight: 700;
}
@media (min-width: 1000px) {
  .foot__points { flex-direction: row; justify-content: center; gap: 0; border-radius: 999px; }
  .foot__points li { padding: 0 18px; }
  .foot__points li + li { border-left: 2px solid var(--stitch); }
}
.foot::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; border-top: 2px dashed var(--stitch); }
.foot__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.foot__brand { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; }
.foot__links { margin: 0; display: flex; flex-wrap: wrap; gap: 0 20px; }
.foot__links a { display: inline-flex; align-items: center; min-height: 44px; }
.foot :focus-visible { outline-color: var(--cream); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
