:root {
  color-scheme: light;
  --bg: #fcf8f2;
  --paper: #fffcf8;
  --ink: #2a2352;
  --muted: #655d76;
  --purple: #503a93;
  --purple-deep: #3c2878;
  --line: #e9e0ec;
  --pink: #f7e6e8;
  --gold: #a45b1c;
  --sage: #377053;
  --shadow: 0 14px 34px #48376e12;
  --round: 22px;
  font-family: 'Thonburi', 'Noto Sans Thai', 'Leelawadee UI', Tahoma, sans-serif;
  font-size: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.65; }
img { display: block; max-width: 100%; object-fit: cover; }
a { text-decoration: none; color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { line-height: 1.27; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3.25rem); }
h2 { font-size: clamp(1.45rem, 2.8vw, 2.13rem); }
h3 { font-size: 1.18rem; }
:focus-visible { outline: 3px solid #9f612a; outline-offset: 4px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: fixed; z-index: 20; top: 6px; left: 6px; transform: translateY(-150%); background: white; padding: .55rem 1rem; border-radius: 8px; }
.skip:focus { transform: none; }
.top { background: #fffcf8; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 72px; gap: 1rem; }
.logo { display: inline-flex; align-items: center; gap: .47rem; width: fit-content; color: #31245e; white-space: nowrap; }
.logo span { font-family: Georgia, serif; font-size: 1.36rem; font-weight: 700; }
.logo i { font-style: normal; color: #8b571f; }
.nav-links, .nav-actions { display: flex; gap: clamp(.55rem, 2.3vw, 1.8rem); align-items: center; }
.nav-links a { position: relative; white-space: nowrap; padding-block: 1.45rem; color: var(--muted); font-weight: 700; }
.nav-links a[aria-current] { color: var(--purple-deep); }
.nav-links a[aria-current]::after { content: ""; position: absolute; bottom: 0; inset-inline: 0; border-radius: 4px 4px 0 0; height: 3px; background: #745baf; }
.nav-actions { justify-content: end; gap: .8rem; }
.cart-link { position: relative; color: var(--purple-deep); display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 50%; }
.cart-link span { min-width: 1.25rem; height: 1.25rem; padding-inline: .24rem; display: grid; place-items: center; position: absolute; top: -4px; right: -5px; background: #6c489a; color: white; font-size: .78rem; border-radius: 50%; border: 1px solid white; }
.account { display: grid; place-items: center; font-size: .94rem; min-height: 42px; text-align: center; border: 1px solid #d9caeb; border-radius: 999px; padding: .38rem .83rem; font-weight: 700; color: var(--purple-deep); background: #f7f1fc; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .44em; min-height: 46px; border: 1px solid transparent; border-radius: 12px; color: var(--purple-deep); padding: .58rem 1rem; font-weight: 700; line-height: 1.32; text-align: center; }
.button svg, .pastel svg, .title-icon svg, .offer-icon svg { width: 1.2em; height: 1.2em; flex: none; }
.button:enabled:hover, a.button:hover, .account:hover, .cart-link:hover { filter: brightness(.94); }
.primary { background: linear-gradient(155deg, #6d55ab, #50358f); border-color: #58409b; box-shadow: 0 3px 0 #35236824; color: #fff; }
.outline { border-color: #d3c4e6; background: #fffcf8; }
.plain { background: transparent; }
.small { min-height: 40px; font-size: .91rem; padding-inline: .7rem; }
.wide { width: 100%; }
.eyebrow { display: flex; align-items: center; gap: .38em; font-size: .93rem; color: var(--purple); font-weight: 700; }
.eyebrow span { color: var(--gold); }
.hero { position: relative; background: radial-gradient(ellipse at 8% 75%, #f6e6e6, transparent 45%), radial-gradient(ellipse at 74% 10%, #ede7f5, transparent 59%), #fcf6eb; border-bottom: 1px solid #eee5e8; overflow: hidden; }
.hero-inner { min-height: 475px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); align-items: center; gap: 1.3rem; padding-block: 1.1rem; }
.hero-copy { padding-block: 2.4rem 3rem; position: relative; z-index: 1; }
.hero-copy h1 { font-family: Georgia, serif; color: #32225e; font-size: clamp(3rem, 6vw, 5.05rem); line-height: .98; letter-spacing: -.075em; margin-block: .65rem 1.15rem; }
.hero-copy h1 span { color: #936021; font-size: .69em; letter-spacing: -0.06em; }
.hero-copy h2 { font-size: clamp(1.73rem, 3.6vw, 3rem); }
.hero-copy > p:not(.eyebrow) { color: var(--muted); max-width: 33ch; margin-block: 1rem 1.3rem; }
.hero-actions, .details-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.hero-art { width: 100%; height: auto; aspect-ratio: 1.5; object-fit: cover; border-radius: 28px; border: 1px solid #fff9ef; box-shadow: 0 16px 35px #41345d23; }
.benefits { margin-top: 1.6rem; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); border: 1px solid var(--line); border-radius: var(--round); background: var(--paper); }
.benefits > div { display: flex; gap: .85rem; align-items: center; padding: 1rem clamp(.8rem, 2.3vw, 1.65rem); }
.benefits > div + div { border-left: 1px solid var(--line); }
.benefits p { font-size: .9rem; color: var(--muted); }
.pastel, .title-icon { display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 15px; font-size: 1.23rem; color: #56368c; background: #eee5f8; }
.honey { color: #925221; background: #f8ecd5; }
.green { color: #3d694c; background: #e5eedf; }
.section { padding-block: 2rem 3.15rem; }
.section-head { display: flex; gap: .85rem; justify-content: space-between; align-items: end; margin-bottom: 1.15rem; }
.section-head p { color: var(--muted); margin-top: .3rem; }
.text-link { font-weight: 700; color: var(--purple-deep); text-decoration: underline; text-underline-offset: 4px; }
.book-grid { display: grid; gap: clamp(1rem, 2.8vw, 1.55rem); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.book-card, .panel { border: 1px solid var(--line); border-radius: var(--round); background: var(--paper); box-shadow: var(--shadow); }
.book-card { padding: .8rem; display: flex; flex-direction: column; }
.cover-link { display: block; border-radius: 14px; }
.cover { width: 100%; display: grid; align-items: start; position: relative; aspect-ratio: 1.08; isolation: isolate; overflow: hidden; border-radius: 15px; background: #f4e6df; }
.cover-sage { background: #eaf0df; }
.cover-lilac { background: #ebe4f4; }
.cover > img { position: absolute; width: 100%; height: 100%; object-position: center; z-index: -2; }
.cover::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg,#fffcf3f2 1%, #fff9e7dc 18%, #fff9e700 42%), linear-gradient(90deg,#51417238 0,transparent 4%); }
.cover-copy { text-align: center; color: #30245a; margin: .75rem .45rem 0; line-height: 1.22; text-shadow: 0 1px #fff5dd; }
.cover-copy > span { display: block; font-family: Georgia, serif; font-size: .95rem; font-weight: 700; margin-bottom: .3rem; }
.cover-copy strong { display: block; font-size: clamp(1.03rem, 2.3vw, 1.65rem); }
.book-meta { padding: .82rem .28rem .28rem; display: flex; flex: 1; flex-direction: column; }
.book-meta > p { color: var(--purple); font-size: .9rem; margin-bottom: .28rem; }
.book-meta h3 { margin-bottom: .58rem; }
.book-meta .green-button { align-self: start; margin-top: auto; }
.book-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: auto; }
.book-actions > strong, .large-price, .offer-price strong, .total strong { color: #982d4d; }
.offer { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 1.2rem; border-radius: var(--round); padding: 1rem 1.2rem; margin-block: 1.4rem 3rem; border: 1px solid #f1d2dc; background: radial-gradient(ellipse at 20% 14%, #fff3dc, transparent 52%), #faedf2; }
.offer h2 { font-size: 1.5rem; margin-bottom: .28rem; }
.offer p:not(.eyebrow) { color: var(--muted); }
.offer-icon { display: grid; place-items: center; position: relative; background: #f7e4b9; color: #80501e; border-radius: 22px; width: 69px; height: 69px; font-size: 1.8rem; }
.offer-icon svg:nth-child(2) { position: absolute; color: #97621c; background: #fff3d1; border-radius: 50%; top: -2px; right: -5px; width: .85em; height: .85em; }
.offer-price { display: grid; text-align: center; white-space: nowrap; }
.offer-price strong { font-size: 1.35rem; }
.offer-price del { color: var(--muted); font-size: .85rem; }
.page-title { padding-block: 2rem; border-bottom: 1px solid #eee5ed; background: radial-gradient(ellipse at 15% 5%, #eee3f8, transparent 64%), radial-gradient(ellipse at 80% 88%, #f9e5d8, transparent 65%), #fcf5ee; }
.title-inner { display: flex; gap: 1rem; align-items: center; }
.title-inner > .title-icon { width: 58px; height: 58px; border: 1px solid #ddd1ed; font-size: 1.55rem; background: #f3eafa; }
.title-inner p { margin-top: .45rem; color: var(--muted); }
.shop-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: 1.25rem; }
.shop-toolbar > span { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.filter { border: 1px solid var(--line); border-radius: 999px; padding: .46rem .82rem; color: var(--muted); background: var(--paper); font-weight: 700; }
.filter[aria-pressed="true"] { background: #ece2f6; border-color: #d4c2eb; color: var(--purple-deep); }
.upcoming h2 { margin-bottom: .9rem; }
.upcoming-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; }
.upcoming-card { display: flex; gap: .7rem; align-items: center; background: #fdf9f5; border: 1px dashed #d9ccdf; border-radius: 15px; padding: .72rem; }
.upcoming-card p { color: var(--muted); font-size: .88rem; }
.upcoming-card h3 { font-size: 1rem; }
.crumb { color: var(--muted); margin-bottom: .9rem; }
.crumb a { text-decoration: underline; text-underline-offset: 4px; }
.details { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.2fr); gap: clamp(1rem, 4vw, 3rem); align-items: center; padding: clamp(.9rem, 3vw, 2rem); }
.details .cover { aspect-ratio: 1; }
.details h1 { margin-block: .5rem .65rem; }
.details-copy > p:not(.eyebrow) { color: var(--muted); max-width: 44ch; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.tags span { background: #f0e8f5; color: var(--purple-deep); padding: .3rem .58rem; border-radius: 8px; font-size: .89rem; }
.large-price { font-size: 1.95rem; display: block; margin-block: .8rem; }
.preview-block { padding-bottom: 0; }
.preview-card { display: grid; overflow: hidden; grid-template-columns: 1fr 1fr; align-items: center; }
.preview-card img { width: 100%; max-height: 230px; }
.preview-card div { padding: 1.2rem; }
.preview-card p { color: var(--muted); margin-block: .4rem; }
.empty { margin: 0 auto 1rem; text-align: center; padding: clamp(1.7rem, 5vw, 4rem) 1rem; background: var(--paper); border: 1px dashed #dacde3; border-radius: var(--round); }
.empty h2, .summary h2 { margin-top: .5rem; }
.empty p, .summary > p:not(.total) { margin-block: .5rem 1rem; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.cart-panel, .summary { padding: clamp(1rem, 2.7vw, 1.7rem); }
.cart-panel h2, .summary h2 { font-size: 1.45rem; margin-bottom: .85rem; }
.cart-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: .75rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.cart-row img { border-radius: 6px; }
.cart-row p, .order p { color: var(--muted); font-size: .87rem; }
.remove { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--purple-deep); font-size: 1.4rem; display: grid; align-content: center; }
.total { display: flex; justify-content: space-between; gap: 1rem; padding-block: .8rem; border-top: 1px solid var(--line); font-weight: 700; }
.total strong { font-size: 1.19rem; }
.summary .saving { color: var(--sage) !important; margin-top: 0 !important; font-weight: 700; }
.summary .primary { margin-block: .4rem; }
.login-layout { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 930px; margin: auto; overflow: hidden; }
.login-art { background: linear-gradient(155deg, #eee7f7, #fff0dc); display: grid; align-content: center; text-align: center; }
.login-art img { width: 100%; height: auto; aspect-ratio: 1.5; border-radius: 0 0 16px 0; }
.login-art div, .login-form { padding: clamp(1.15rem, 3.5vw, 2.4rem); }
.login-art h2 { font-size: 1.45rem; }
.login-art p, .login-form p, .help p { color: var(--muted); }
.login-form h1 { font-size: 1.9rem; margin-block: .55rem .5rem; }
.login-form form { margin-block: 1rem; }
.login-form label { font-weight: 700; display: block; margin-bottom: .25rem; }
.login-form input { width: 100%; min-height: 48px; padding: .55rem .7rem; border-radius: 10px; border: 1px solid #d3c4e0; background: white; color: var(--ink); }
#login-note { margin-block: .36rem .75rem; font-size: .9rem; }
.steps { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .55rem; margin: 0 0 1rem; }
.steps li { padding: .4rem .75rem; background: #f1eaf5; border-radius: 999px; color: var(--muted); }
.steps li[aria-current] { background: var(--purple); color: white; font-weight: 700; }
.receipt-line { padding: .61rem 0; border-top: 1px solid var(--line); }
.order { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; margin-bottom: .7rem; }
.green-button { background: #2f674c; color: white; margin-top: .25rem; }
.reader-wrap { max-width: 1020px; text-align: center; }
.reader-head { display: grid; grid-template-columns: 1fr minmax(0,2.3fr) 1fr; align-items: center; justify-items: center; gap: .5rem; margin-bottom: 1rem; }
.reader-head h1 { font-size: clamp(1.25rem,3vw,2.35rem); }
.reader-head .eyebrow { justify-content: center; margin-bottom: .2rem; }
.reader-head > a { justify-self: start; }
.contents { position: relative; justify-self: end; z-index: 3; text-align: left; }
.contents summary { cursor: pointer; list-style: none; }
.contents summary::-webkit-details-marker { display: none; }
.contents ol { position: absolute; inset: auto 0 auto auto; min-width: min(245px, 80vw); max-height: 60vh; overflow: auto; margin-top: .4rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .55rem .8rem .55rem 2rem; }
.contents li a { display: block; padding: .35rem 0; }
.contents a[aria-current] { color: var(--purple-deep); font-weight: 700; }
.book-stage { perspective: 1350px; touch-action: pan-y; }
.spread { display: grid; grid-template-columns: repeat(2,minmax(0, 1fr)); background: #eaddbe; gap: 1px; border: 1px solid #d9caaa; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 0 #e4d3b5, 0 9px 0 #f4e7c9, 0 20px 30px #54467124; text-align: left; transform-origin: center; min-height: 320px; }
.spread-art { position: relative; }
.spread-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg,transparent 94%,#5f472627); }
.spread-art img { width: 100%; height: 100%; min-height: 320px; }
.spread-copy { display: grid; align-content: center; position: relative; background: radial-gradient(ellipse at 80% 100%, #f7dfd9, transparent 50%), linear-gradient(90deg, #e9dbc1 0, #fff9ea 7%, #fff9ed 100%); padding: clamp(1rem, 4vw, 3.6rem); }
.spread-copy > p:not(.eyebrow) { margin-top: .6rem; font-size: clamp(1.08rem, 2.2vw, 1.38rem); }
.spread-star { color: #9c691b; margin-top: .7rem; width: fit-content; }
.flip-next { animation: turn-next .35s ease-out; }
.flip-prev { animation: turn-prev .35s ease-out; }
@keyframes turn-next { from { transform: rotateY(-13deg) translateX(1%); opacity: .62; } to { transform: none; opacity: 1; } }
@keyframes turn-prev { from { transform: rotateY(13deg) translateX(-1%); opacity: .62; } to { transform: none; opacity: 1; } }
.reader-controls { margin: 1.25rem auto .1rem; display: flex; align-items: center; justify-content: center; gap: clamp(.4rem,2vw,.95rem); }
.page-count { white-space: nowrap; font-weight: 700; color: var(--purple-deep); }
.reader-hint { color: var(--muted); font-size: .9rem; margin: .5rem 0; }
.activity-link { background: #f7ecd4; border-color: #efdfb2; color: #6f4419; }
.help { padding: clamp(1rem, 4vw, 2rem); max-width: 760px; }
.help h2 { font-size: 1.35rem; margin-bottom: .35rem; }
.help p { margin-bottom: 1rem; }
.footer { border-top: 1px solid var(--line); background: #faf3ec; }
.footer-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-inner p, .footer-inner > a:last-child { font-size: .9rem; color: var(--muted); }
.footer-inner > a:last-child { text-decoration: underline; text-underline-offset: 4px; }
.toast { pointer-events: none; visibility: hidden; opacity: 0; position: fixed; z-index: 10; bottom: 1rem; left: 50%; transform: translate(-50%, .4rem); width: max-content; max-width: calc(100% - 2rem); text-align: center; padding: .6rem 1rem; border-radius: 12px; background: #36275f; color: white; box-shadow: var(--shadow); transition: opacity .18s, transform .18s; }
.toast.shown { visibility: visible; opacity: 1; transform: translate(-50%,0); }
.no-script { padding: 1rem; }
@media (max-width: 800px) {
  .wrap { width: calc(100% - 32px); }
  .hero-inner { min-height: 375px; gap: .85rem; }
  .book-card { padding: .55rem; }
  .benefits > div { padding-inline: .65rem; gap: .48rem; }
  .benefits .pastel { width: 38px; height: 38px; }
}
@media (max-width: 650px) {
  .nav { grid-template-columns: minmax(0,1fr) auto; gap: 0 .5rem; padding-top: .45rem; }
  .nav-actions { grid-column: 2; grid-row: 1; gap: .42rem; }
  .nav-links { grid-column: 1 / -1; justify-content: space-around; gap: .5rem; }
  .nav-links a { padding-block: .48rem; font-size: .91rem; }
  .logo span { font-size: 1.16rem; }
  .logo img { width: 30px; height: 30px; }
  .cart-link, .account { min-height: 36px; }
  .cart-link { width: 36px; height: 36px; }
  .account { font-size: .84rem; white-space: nowrap; }
  .hero-inner { grid-template-columns: 1fr; gap: 0; min-height: 0; padding-bottom: .1rem; }
  .hero-copy { padding: 1.6rem 0 0; text-align: center; }
  .hero-copy .eyebrow, .hero-actions { justify-content: center; }
  .hero-copy h1 { font-size: clamp(2.85rem, 12vw, 4rem); }
  .hero-copy > p:not(.eyebrow) { margin: .65rem auto .9rem; }
  .hero-art { width: min(100%, 430px); margin: .85rem auto .75rem; }
  .benefits { gap: 0; }
  .benefits > div { flex-direction: column; align-items: center; text-align: center; gap: .33rem; padding: .6rem .25rem; }
  .benefits strong { line-height: 1.32; display: block; }
  .benefits p { display: none; }
  .book-grid, .upcoming-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .offer { grid-template-columns: auto 1fr; gap: .7rem; }
  .offer-price { text-align: left; }
  .offer .button { justify-self: start; }
  .details, .split, .login-layout { grid-template-columns: 1fr; }
  .details .cover { aspect-ratio: 1.35; }
  .preview-card img { height: 100%; }
  .login-art { grid-template-columns: 1fr 1fr; align-items: center; }
  .login-art div { padding: .5rem .5rem .5rem 0; }
  .login-art p { font-size: .88rem; }
  .reader-head .button { min-height: 36px; padding-inline: .38rem; font-size: .82rem; }
  .reader-head .button svg { display: none; }
  .spread { grid-template-columns: 1fr; gap: 0; }
  .spread-art img { max-height: 265px; min-height: 0; height: auto; aspect-ratio: 1.48; }
  .spread-art::after { background: linear-gradient(180deg,transparent 92%,#5f472620); }
  .spread-copy { background: radial-gradient(ellipse at 92% 100%, #f7dfd9, transparent 55%), #fff9ec; min-height: 175px; }
  .reader-controls .button { font-size: .88rem; padding-inline: .55rem; }
  .section { padding-block: 1.25rem 2.35rem; }
  .footer-inner { justify-content: flex-start; gap: .55rem .8rem; flex-wrap: wrap; padding-block: .7rem; }
  .footer-inner p { order: 2; width: 100%; }
}
@media (max-width: 355px) {
  .wrap { width: calc(100% - 22px); }
  .section-head { align-items: start; flex-direction: column; }
  .book-actions > .button { padding-inline: .36rem; }
  .reader-head .eyebrow { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.activity { margin-top: 1rem; padding: 1rem; text-align: left; }
.activity fieldset { border: 0; margin: 0; padding: 0; }
.activity legend { font-weight: 700; padding: 0; margin-bottom: .55rem; }
.activity label { display: inline-flex; gap: .35rem; align-items: center; padding: .32rem .75rem; margin: 0 .38rem .45rem 0; border: 1px solid var(--line); border-radius: 10px; }
.activity input { accent-color: var(--purple); }
.activity .answer:not(:empty) { margin-top: .5rem; color: var(--purple-deep); font-weight: 700; }
