/* Rena Academy · wongwarit.com/rena/academy
   ใช้ภาษาภาพเดียวกับ Rena's Journal · ห้องเรียนแบบคุยกับเรนะ + กิจกรรมลากวาง · เคารพ prefers-reduced-motion */

:root {
  --bg: #fbf6f4; --bg2: #f5ecf2; --ink: #2a2238; --ink2: #554b68; --muted: #7c728c;
  --line: rgba(42, 34, 56, .11); --card: rgba(255, 255, 255, .78); --card-solid: #fff;
  --pink: #d9558f; --pink2: #f5a3c7; --lav: #8a73d9; --lav2: #cfc3f5; --mint: #3f9e86; --mint2: #c9efe4; --peach: #ef9a78; --sky: #6f9fe0;
  --bad: #d4476a; --bad2: #fde0e7; --ok: #2f9c7d; --ok2: #d8f3ea;
  --grad: linear-gradient(100deg, #d9558f 0%, #a274e0 55%, #6f9fe0 100%);
  --shadow: 0 1px 2px rgba(60, 30, 80, .05), 0 12px 32px -12px rgba(90, 50, 120, .22);
  --shadow-lg: 0 2px 6px rgba(60, 30, 80, .06), 0 30px 60px -20px rgba(110, 60, 140, .35);
  --r: 20px; --r-lg: 30px;
  --f-body: "IBM Plex Sans Thai Looped", "Noto Sans Thai", system-ui, sans-serif;
  --f-head: "Noto Serif Thai", "IBM Plex Sans Thai Looped", serif;
  --f-script: "Fraunces", "Noto Serif Thai", serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --wrap: 1140px; --gut: clamp(16px, 4vw, 32px); --nav-h: 66px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #140f1d; --bg2: #1b1428; --ink: #f4eef8; --ink2: #cbc1d8; --muted: #a197b2;
  --line: rgba(255, 255, 255, .11); --card: rgba(34, 26, 48, .74); --card-solid: #221a30;
  --pink: #f58cba; --pink2: #f5a3c7; --lav: #b4a2f5; --lav2: #4b3d73; --mint: #7fd6c0; --mint2: #1f3d36; --peach: #f5b096; --sky: #93bdf5;
  --bad: #ff8fab; --bad2: #4a2030; --ok: #7fd6c0; --ok2: #1d3b33;
  --grad: linear-gradient(100deg, #f58cba 0%, #b9a0ff 55%, #8fc0ff 100%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 36px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 30px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #140f1d; --bg2: #1b1428; --ink: #f4eef8; --ink2: #cbc1d8; --muted: #a197b2;
    --line: rgba(255, 255, 255, .11); --card: rgba(34, 26, 48, .74); --card-solid: #221a30;
    --pink: #f58cba; --pink2: #f5a3c7; --lav: #b4a2f5; --lav2: #4b3d73; --mint: #7fd6c0; --mint2: #1f3d36; --peach: #f5b096; --sky: #93bdf5;
    --bad: #ff8fab; --bad2: #4a2030; --ok: #7fd6c0; --ok2: #1d3b33;
    --grad: linear-gradient(100deg, #f58cba 0%, #b9a0ff 55%, #8fc0ff 100%);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 36px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 30px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.75 var(--f-body); overflow-x: hidden; -webkit-font-smoothing: antialiased; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pink); }
:focus-visible { outline: 3px solid var(--lav); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--card-solid); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--f-head); line-height: 1.35; margin: 0 0 .5em; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gut)); margin-inline: auto; }
.narrow { width: min(640px, 100% - 2 * var(--gut)); margin-inline: auto; }
.pad { padding-block: clamp(32px, 6vw, 64px); }
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--ink2); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.inline { display: inline; margin: 0; }
.eyebrow { font-family: var(--f-script); font-style: italic; color: var(--pink); font-size: 1.08rem; margin-bottom: .4em; }

/* เผยทีละชิ้นตอนเลื่อน (เปิดเมื่อ JS พร้อมเท่านั้น) */
.rise-ready [data-rise] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rise-ready [data-rise].in { opacity: 1; transform: none; }

/* ฉากหลังออโรร่า */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: .5; }
.aurora i:nth-child(1) { background: radial-gradient(circle, #f9c6dc 0%, transparent 65%); top: -25vmax; left: -15vmax; animation: drift1 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: radial-gradient(circle, #d9cdfb 0%, transparent 65%); top: 10vmax; right: -25vmax; animation: drift2 32s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: radial-gradient(circle, #cfe6fb 0%, transparent 65%); bottom: -30vmax; left: 15vmax; animation: drift3 38s ease-in-out infinite alternate; opacity: .4; }
:root[data-theme="dark"] .aurora i { opacity: .24; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .aurora i { opacity: .24; } }
@keyframes drift1 { to { transform: translate(18vmax, 12vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vmax, 14vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(-10vmax, -16vmax) scale(1.1); } }

/* แถบนำทาง */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); display: flex; align-items: center; gap: 12px; padding: 0 max(var(--gut), calc((100vw - var(--wrap)) / 2)); }
.nav::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card-solid), 0 0 0 4px var(--pink2); transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand span { font-family: var(--f-script); font-size: 1.3rem; line-height: 1; white-space: nowrap; }
.brand b { font-weight: 600; }
.brand em { font-style: italic; color: var(--pink); }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: .95rem; color: var(--ink2); }
.nav-links a:hover { color: var(--ink); background: color-mix(in srgb, var(--pink2) 22%, transparent); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--pink2) 30%, transparent); }
.nav-tools { display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; grid-area: 1 / 1; transition: transform .5s var(--ease), opacity .3s; }
.i-moon { fill: currentColor !important; stroke: none !important; }
.i-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
:root[data-theme="dark"] .i-sun { opacity: 1; transform: none; }
:root[data-theme="dark"] .i-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { opacity: 1; transform: none; }
  :root:not([data-theme="light"]) .i-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
}
.burger { display: none; }
.burger span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; grid-area: 1 / 1; transition: transform .4s var(--ease); }
.burger span:first-child { transform: translateY(-4px); }
.burger span:last-child { transform: translateY(4px); }
.menu-open .burger span:first-child { transform: rotate(45deg); }
.menu-open .burger span:last-child { transform: rotate(-45deg); }
@media (max-width: 820px) {
  .burger { display: grid; }
  .nav-links { position: fixed; inset: var(--nav-h) 0 auto 0; height: calc(100dvh - var(--nav-h)); flex-direction: column; align-items: stretch; gap: 6px; padding: 24px var(--gut); background: color-mix(in srgb, var(--bg) 96%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); visibility: hidden; opacity: 0; transition: opacity .3s, visibility .3s; }
  .nav-links a { font-family: var(--f-head); font-size: 1.35rem; padding: 14px 18px; border-radius: 18px; }
  .menu-open .nav-links { visibility: visible; opacity: 1; }
  .brand span { font-size: 1.1rem; }
}

/* ปุ่ม */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 1rem; line-height: 1.4;
  border: 1px solid transparent; cursor: pointer; font-family: inherit; color: var(--ink); transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s, opacity .3s; }
.btn.primary { background: var(--grad); background-size: 160% 100%; color: #fff; box-shadow: 0 10px 26px -10px rgba(217, 85, 143, .7); }
.btn.primary:hover { background-position: 100% 0; transform: translateY(-1px); }
.btn.ghost { background: var(--card); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--pink2); }
.btn.sm { padding: 8px 16px; font-size: .9rem; }
.btn.xs { padding: 4px 12px; font-size: .8rem; }
.btn.block { width: 100%; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ข้อความแจ้ง */
.flash { padding: 12px 16px; border-radius: 14px; font-size: .95rem; border: 1px solid var(--line); background: var(--card); }
.flash.error { background: var(--bad2); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.flash.warn { background: color-mix(in srgb, var(--peach) 18%, var(--card-solid)); }
.flash.ok { background: var(--ok2); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.warn-t { color: var(--bad); }

/* หน้าแรก */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: clamp(32px, 7vw, 88px); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero-art { position: relative; justify-self: center; max-width: 380px; }
.hero-art img { border-radius: var(--r-lg); box-shadow: var(--shadow-lg); aspect-ratio: 4 / 5; object-fit: cover; }
.bubble { position: absolute; background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 10px 16px; border-radius: 18px; font-size: .92rem; font-weight: 500; animation: float 5s ease-in-out infinite; white-space: nowrap; }
.bubble.b1 { left: -28px; top: -22px; border-bottom-left-radius: 4px; }   /* เหนือศีรษะ ไม่บังหน้าเรนะ */
.bubble.b2 { right: -16px; bottom: 22%; color: var(--pink); font-weight: 700; animation-delay: -2.5s; }
@keyframes float { 50% { transform: translateY(-10px); } }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: clamp(40px, 7vw, 80px); }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.feat span { font-size: 2rem; display: block; margin-bottom: 8px; }
.feat p { color: var(--ink2); margin: 0; font-size: .95rem; }
.sec-title { margin-bottom: 20px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: clamp(40px, 7vw, 80px); }
.course-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.course-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--grad); }
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.course-card p { color: var(--ink2); margin: 0; }
.cc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
/* ภาพปกการ์ดคอร์ส: เต็มขอบบน · ไอคอน+วงความคืบหน้าลอยทับมุมล่างของภาพ */
.cc-cover { margin: -26px -26px 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--line); }
.cc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.course-card:hover .cc-cover img { transform: scale(1.04); }
.course-card.has-cover::before { z-index: 1; }
.course-card.has-cover .cc-top { margin-top: -34px; position: relative; z-index: 1; }
.course-card.has-cover .cc-emoji { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.course-card.has-cover .ring { background: var(--card); border-radius: 50%; box-shadow: var(--shadow); }
.cc-emoji { font-size: 2.4rem; }
.meta { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 10px 0; }
.meta li { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--lav2) 45%, transparent); color: var(--ink2); }
.cc-cta { margin-top: auto; font-weight: 600; color: var(--pink); }
.how { margin-bottom: clamp(40px, 7vw, 80px); }
.steps-row { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.steps-row li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; color: var(--ink2); }
.steps-row b { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; }
.verify-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; margin-bottom: 64px; text-align: center; }
.row-form { display: flex; gap: 10px; }
.row-form input { flex: 1; }

/* ฟอร์ม */
input, textarea, select { font: inherit; color: var(--ink); background: var(--card-solid); border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 14px; width: 100%; transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus { outline: none; border-color: var(--lav); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lav) 22%, transparent); }
.form { display: grid; gap: 14px; margin: 18px 0; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
.form label small { color: var(--muted); font-weight: 400; }
.form .check { grid-template-columns: auto 1fr; align-items: start; font-weight: 400; font-size: .86rem; color: var(--ink2); }
.form .check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--pink); }
.auth { display: grid; place-items: center; padding-block: clamp(32px, 7vw, 72px); }
.auth-card { width: min(460px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px, 5vw, 40px); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.auth-card h1 { font-size: 1.7rem; text-align: center; }
.auth-face { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px; box-shadow: 0 0 0 3px var(--card-solid), 0 0 0 6px var(--pink2); }

/* วงแหวนความคืบหน้า */
.ring { flex: none; }
.ring .ring-bg { fill: none; stroke: color-mix(in srgb, var(--lav2) 60%, transparent); stroke-width: 5; }
.ring .ring-fg { fill: none; stroke: var(--pink); stroke-width: 5; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1s var(--ease); }
.ring text { font: 600 12px var(--f-body); fill: var(--ink); }

/* หน้าคอร์ส */
.course-hero { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; padding-block: clamp(28px, 6vw, 64px); }
.course-stat { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 28px; box-shadow: var(--shadow); }
.course-stat p { margin: 8px 0 0; color: var(--ink2); }
.course-body { display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: start; padding-bottom: 72px; }
.outcomes { position: sticky; top: calc(var(--nav-h) + 16px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.outcomes h2 { font-size: 1.2rem; }
.ticks { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 8px; }
.ticks li { padding-left: 30px; position: relative; color: var(--ink2); font-size: .95rem; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; background: var(--grad); }
.modules { display: grid; gap: 16px; }
.module { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); }
.module h3 { display: flex; align-items: center; gap: 12px; }
.mnum { flex: none; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--pink2) 35%, transparent); color: var(--pink); font-family: var(--f-body); }
.lessons { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.lesson > a, .lesson > span { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; text-decoration: none; color: var(--ink); }
.lesson > a:hover { background: color-mix(in srgb, var(--pink2) 18%, transparent); }
.ls-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .8rem; background: color-mix(in srgb, var(--lav2) 50%, transparent); }
.lesson.done .ls-ico { background: var(--ok); color: #fff; }
.lesson.open .ls-ico { background: var(--grad); color: #fff; }
.lesson.locked { opacity: .55; }
.ls-m { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.exam-card.ready { border-color: var(--pink2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink2) 35%, transparent), var(--shadow); }
.exam-card p { color: var(--ink2); font-size: .95rem; }

/* ห้องเรียน */
.player-wrap { width: min(760px, 100% - 2 * var(--gut)); margin: 0 auto; padding: 18px 0 120px; }
.player-top { position: sticky; top: var(--nav-h); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 0; background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pbar { flex: 1; height: 12px; border-radius: 999px; background: color-mix(in srgb, var(--lav2) 55%, transparent); overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .6s var(--ease); }
.xp-pill { font-weight: 600; font-size: .9rem; padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); white-space: nowrap; }
.xp-pill b { color: var(--pink); }
.xp-pill.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.25); } }
.timer.low { color: var(--bad); border-color: var(--bad); }
.lesson-head { margin: 18px 0 8px; }
.lesson-head h1 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
.stage { display: grid; gap: 16px; }
.loading { color: var(--muted); }

.msg { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: end; animation: rise .55s var(--ease) both; }
.msg .av { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card-solid), 0 0 0 4px var(--pink2); }
.msg .bub { background: var(--card-solid); border: 1px solid var(--line); border-radius: 22px 22px 22px 6px; padding: 14px 18px; box-shadow: var(--shadow); }
.msg .bub p:last-child { margin: 0; }
/* เสียงเรนะสอน: ขอบเรืองตอนกำลังพูด · ปุ่มข้าม/ฟังต่อ/ฟังซ้ำในบับเบิล · ปุ่ม 🎧 + ความเร็วบนแถบบน */
.msg .bub.speaking, .card.speaking, .act.speaking { border-color: var(--pink2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink2) 35%, transparent), var(--shadow); }
.msg .bub { position: relative; }
.msg .bub > :last-child:is(p, ul, ol), .msg .bub > :nth-last-child(2):has(+ .v-btn) { margin-bottom: 0; }
.v-btn { position: absolute; right: -10px; bottom: -10px; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--card-solid); color: var(--lav); font: inherit; font-size: .9rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.v-btn::after { content: ''; position: absolute; inset: -6px; }
.v-btn[data-mode="stop"], .v-btn[data-mode="resume"] { color: var(--pink); border-color: var(--pink2); }
.v-ctl { display: inline-flex; gap: 6px; flex: none; }
.v-ctl button { min-width: 44px; height: 44px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink2); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; }
.v-ctl .v-tog { font-size: 1.1rem; }
.v-ctl .v-tog[aria-pressed="true"] { border-color: var(--pink2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink2) 25%, transparent); }
.v-ctl [hidden] { display: none; }
.v-ctl .bgm-tog[aria-pressed="false"] { opacity: .5; filter: grayscale(1); }
.v-note { font-size: .88rem; color: var(--ink2); background: color-mix(in srgb, var(--lav2) 28%, transparent); border: 1px dashed var(--line); border-radius: 14px; padding: 10px 14px; margin: 8px 0 0; }
.v-miss { font-size: .76rem; color: var(--muted); margin: 8px 0 0 !important; }
.v-speed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; }
.v-speed-l { font-size: .85rem; color: var(--muted); margin-right: 2px; }
.v-rate, .v-try { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink2); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.v-rate[aria-pressed="true"] { border-color: var(--pink2); color: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink2) 25%, transparent); }
.v-try { color: var(--lav); }
.v-gate .row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.v-gate .small { font-size: .8rem; margin: 0; }
@media (prefers-reduced-motion: no-preference) {
  .msg .bub.speaking { animation: vglow 1.4s ease-in-out infinite alternate; }
  @keyframes vglow { to { box-shadow: 0 0 0 6px color-mix(in srgb, var(--pink2) 18%, transparent), var(--shadow); } }
}
@media (max-width: 480px) { .v-ctl .v-spd { min-width: 40px; padding: 0 6px; } .player-top { gap: 8px; } }
.typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--pink2); animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-5px); opacity: .5; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

.card, .act { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(18px, 3vw, 26px); box-shadow: var(--shadow); animation: rise .55s var(--ease) both; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.card h3, .act h3 { font-size: 1.12rem; }
.card ul, .card ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.card .tbl-wrap { margin: 0; }
.act { border-color: color-mix(in srgb, var(--lav) 35%, transparent); }
.act-tag { display: inline-flex; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--lav); text-transform: none; margin-bottom: 6px; }
.act-q { font-weight: 600; font-size: 1.05rem; margin-bottom: 14px; }
.hint { font-size: .85rem; color: var(--muted); margin: -8px 0 12px; }

.choices { display: grid; gap: 10px; }
.choice { text-align: left; font: inherit; color: var(--ink); background: var(--card-solid); border: 2px solid var(--line); border-radius: 16px; padding: 12px 16px; cursor: pointer; display: flex; gap: 12px; align-items: center; transition: border-color .2s, transform .2s var(--ease), background-color .2s; }
.choice:hover:not([disabled]) { border-color: var(--pink2); transform: translateX(3px); }
.choice .key { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: color-mix(in srgb, var(--lav2) 55%, transparent); }
.choice.sel { border-color: var(--lav); background: color-mix(in srgb, var(--lav2) 30%, var(--card-solid)); }
.choice.right { border-color: var(--ok); background: var(--ok2); }
.choice.wrong { border-color: var(--bad); background: var(--bad2); animation: shake .4s; }
.choice[disabled] { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ชิ้นที่ลากได้ */
.chip-d { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; font: inherit; font-size: .95rem; color: var(--ink); background: var(--card-solid); border: 2px solid var(--line); border-radius: 14px; padding: 9px 14px; box-shadow: 0 2px 0 var(--line); transition: transform .2s var(--ease), border-color .2s, opacity .2s; text-align: left; }
.chip-d:hover { border-color: var(--pink2); }
.chip-d.picked { border-color: var(--lav); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lav) 25%, transparent); }
.chip-d.right { border-color: var(--ok); background: var(--ok2); }
.chip-d.wrong { border-color: var(--bad); background: var(--bad2); }
.chip-d.ghosting { opacity: .3; }
.drag-clone { position: fixed; z-index: 1000; pointer-events: none; transform: rotate(-3deg) scale(1.05); box-shadow: var(--shadow-lg); border-color: var(--lav); cursor: grabbing; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; padding: 10px; border-radius: 16px; border: 2px dashed var(--line); margin-bottom: 14px; }
.pool:empty::after { content: "ครบแล้ว ✓"; color: var(--muted); font-size: .9rem; align-self: center; padding: 0 6px; }
.buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.bucket { border: 2px dashed color-mix(in srgb, var(--lav) 45%, transparent); border-radius: 18px; padding: 10px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; background: color-mix(in srgb, var(--lav2) 14%, transparent); transition: background-color .2s, border-color .2s; cursor: pointer; }
.bucket > b { font-size: .9rem; text-align: center; padding-bottom: 4px; }
.drop-hot { border-color: var(--pink) !important; background: color-mix(in srgb, var(--pink2) 24%, transparent) !important; }
.pairs { display: grid; gap: 10px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
.pair .left { background: color-mix(in srgb, var(--pink2) 18%, var(--card-solid)); border-radius: 14px; padding: 10px 14px; font-weight: 500; display: flex; align-items: center; }
.slot { border: 2px dashed color-mix(in srgb, var(--lav) 45%, transparent); border-radius: 14px; min-height: 48px; padding: 4px; display: flex; align-items: center; cursor: pointer; }
.slot:empty::after { content: "วางคำตอบที่นี่"; color: var(--muted); font-size: .85rem; padding: 0 10px; }
.slot .chip-d { width: 100%; }
.order-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: ord; }
.order-list li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.order-list li::before { counter-increment: ord; content: counter(ord); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .82rem; font-weight: 700; background: var(--grad); color: #fff; }
.order-list .chip-d { width: 100%; }
.mv { display: flex; flex-direction: column; gap: 2px; }
.mv button { border: 1px solid var(--line); background: var(--card-solid); color: var(--ink); border-radius: 8px; width: 30px; height: 22px; line-height: 1; cursor: pointer; font-size: .7rem; }
.order-list li.drop-before .chip-d { box-shadow: 0 -4px 0 var(--pink); }
.fill-text { line-height: 2.4; font-size: 1.05rem; margin-bottom: 12px; }
.blank { display: inline-flex; min-width: 96px; min-height: 38px; vertical-align: middle; border-bottom: 3px solid var(--lav); border-radius: 10px 10px 4px 4px; background: color-mix(in srgb, var(--lav2) 25%, transparent); padding: 2px 10px; margin: 0 4px; align-items: center; justify-content: center; cursor: pointer; font-weight: 600; color: var(--pink); }
.blank.on { border-color: var(--pink); }
.blank.right { border-color: var(--ok); background: var(--ok2); color: var(--ok); }
.blank.wrong { border-color: var(--bad); background: var(--bad2); color: var(--bad); }
.word-bank { display: flex; flex-wrap: wrap; gap: 8px; }
.word-bank .chip-d { cursor: pointer; }
.word-bank .chip-d.used { opacity: .3; pointer-events: none; }
/* puzzle ประกอบประโยค */
.aline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; font-size: 1.05rem; line-height: 1.6; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--lav2) 18%, transparent); margin-bottom: 14px; }
.aline.flow { gap: 8px; }
.aword { font-weight: 500; }
.aslot { display: inline-flex; min-width: 110px; min-height: 46px; border: 2px dashed color-mix(in srgb, var(--lav) 55%, transparent); border-radius: 14px; padding: 3px; align-items: center; justify-content: center; cursor: pointer; }
.aslot:empty::after { content: "?"; color: var(--muted); font-weight: 700; }
.aslot .chip-d { width: 100%; }
.aline.flow .aslot { flex: 1 1 130px; }
.aarrow { color: var(--pink); font-weight: 700; }
.chip-d { min-height: 44px; overflow-wrap: anywhere; }
.chip-d.right::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.chip-d.wrong::before { content: "✕ "; color: var(--bad); font-weight: 700; }
/* เกมทายคำถัดไป */
.pstem { font-size: 1.2rem; font-weight: 600; margin-bottom: 14px; }
.pblank { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--pink); color: var(--pink); text-align: center; }
.pgrid { grid-template-columns: repeat(2, 1fr); }
.pbars { margin-top: 16px; display: grid; gap: 8px; }
.pbars .small { font-size: .82rem; margin: 0 0 4px; }
.pbar-row { display: grid; grid-template-columns: 90px 1fr 48px; gap: 10px; align-items: center; font-size: .95rem; }
.pbar-row.top { font-weight: 700; }
.pt { height: 14px; border-radius: 999px; background: color-mix(in srgb, var(--lav2) 45%, transparent); overflow: hidden; }
.pt i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .9s var(--ease); }
.pbars.go .pt i { width: var(--w); }
.pbar-row b { text-align: right; color: var(--pink); }
/* เกม combo */
.gauge { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--peach) 14%, var(--card-solid)); position: sticky; top: calc(var(--nav-h) + 60px); z-index: 5; }
.g-bar { height: 12px; border-radius: 999px; background: color-mix(in srgb, var(--lav2) 45%, transparent); overflow: hidden; }
.g-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--peach), var(--pink)); border-radius: inherit; transition: width .6s var(--ease); }
.gauge.low .g-n { color: var(--bad); }
.round { margin-top: 12px; }
.round-n { font-size: .82rem; color: var(--lav); font-weight: 600; margin: 0; }
.round-t { font-weight: 600; font-size: 1.05rem; }
.seg-group { margin: 10px 0; }
.seg-l { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.segs { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { font: inherit; font-size: .92rem; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card-solid); color: var(--ink); cursor: pointer; }
.seg[aria-checked="true"] { border-color: var(--pink); background: color-mix(in srgb, var(--pink2) 25%, var(--card-solid)); font-weight: 600; }
.seg[disabled] { cursor: default; }
.seg small { color: var(--muted); }
.stars { color: #e8a33d; letter-spacing: 2px; }
.big-stars { font-size: 2rem; font-weight: 700; margin: 8px 0; }
.sample { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card-solid); border: 1px dashed var(--line); font-size: .92rem; }
.sample small { display: block; color: var(--muted); margin-bottom: 4px; }
.sample p:last-child { margin: 0; }
/* เกม spotlight */
.fog-box { padding: 16px; border-radius: 16px; text-align: center; background: linear-gradient(135deg, color-mix(in srgb, var(--lav2) 45%, var(--card-solid)), color-mix(in srgb, var(--sky) 20%, var(--card-solid))); margin-bottom: 12px; }
.fog-box small { display: block; color: var(--muted); }
.fog-box b { font-size: 1.2rem; }
.torch-n { display: inline-block; font-weight: 600; margin-bottom: 10px; }
.spots { display: grid; gap: 8px; }
.spot { text-align: left; font: inherit; color: var(--ink); background: var(--card-solid); border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; cursor: pointer; display: grid; gap: 4px; min-height: 44px; }
.spot[aria-pressed="true"] { border-color: var(--lav); background: color-mix(in srgb, var(--lav2) 30%, var(--card-solid)); }
.spot.gold { border-color: #e8c35a; }
.spot[disabled] { cursor: default; }
.spot.unpicked { opacity: .75; }
.spot.picked.hi { border-color: var(--ok); background: var(--ok2); }
.spot.picked.trap { border-color: var(--bad); background: var(--bad2); }
.spot-tag { font-size: .75rem; font-weight: 700; color: var(--lav); }
.spot.hi .spot-tag { color: var(--ok); } .spot.trap .spot-tag { color: var(--bad); }
.spot-rev { font-size: .86rem; color: var(--ink2); }
.small { font-size: .82rem; }
/* บันไดเทียบ prompt */
.lad-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.lad-tab { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--line); background: var(--card-solid); color: var(--ink); font: 700 .95rem var(--f-body); cursor: pointer; }
.lad-tab.seen { border-color: var(--lav2); }
.lad-tab[aria-selected="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.lad-label { font-weight: 700; color: var(--pink); margin-bottom: 8px; }
.lad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.lad-prompt, .lad-refs, .lad-result { background: var(--card-solid); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.lad-refs { margin-top: 10px; }
.lad-prompt small, .lad-refs small, .lad-result small { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 6px; }
.lad-prompt p { margin: 0; font-size: .95rem; }
.lad-prompt mark { background: color-mix(in srgb, var(--pink2) 45%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
.lad-ref-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lad-ref { margin: 0; width: 84px; }
.lad-ref img { border-radius: 10px; aspect-ratio: 1; object-fit: cover; }
.lad-ref figcaption { font-size: .7rem; color: var(--muted); text-align: center; }
.lad-out { margin: 0; }
.lad-out img { border-radius: 12px; width: 100%; }
.ai-tag { display: inline-block; margin-top: 6px; font-size: .7rem; color: var(--muted); }
.lad-note { margin: 10px 0 0; font-size: .92rem; color: var(--ink2); }
.card-img { margin: 0 0 12px; }
.card-img img { border-radius: 14px; width: 100%; max-height: 420px; object-fit: cover; }
.card-img figcaption { font-size: .8rem; color: var(--muted); }
@media (max-width: 640px) { .lad-grid { grid-template-columns: 1fr; } }
.scenario-box { background: color-mix(in srgb, var(--peach) 14%, var(--card-solid)); border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; }
.scenario-box::before { content: "🎬 สถานการณ์"; display: block; font-size: .8rem; font-weight: 600; color: var(--peach); margin-bottom: 4px; }
textarea { min-height: 110px; resize: vertical; }
.recap { background: linear-gradient(135deg, color-mix(in srgb, var(--pink2) 26%, var(--card-solid)), color-mix(in srgb, var(--lav2) 30%, var(--card-solid))); }
.recap ul { list-style: none; padding: 0; }
.recap li { padding-left: 28px; position: relative; }
.recap li::before { content: "✨"; position: absolute; left: 0; }
.video-box video { width: 100%; border-radius: 16px; background: #000; }
.video-box .vframe { position: relative; width: 100%; aspect-ratio: var(--ratio, 16/9); max-height: 72vh; margin: 0 auto; border-radius: 16px; overflow: hidden; background: #000; }
.video-box .vframe[style*="9/16"], .video-box .vframe[style*="3/4"], .video-box .vframe[style*="4/5"] { width: auto; height: min(72vh, 640px); }
.video-box .vframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vdone { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: .88rem; font-weight: 600; color: var(--pink); background: color-mix(in srgb, var(--pink2) 14%, transparent); }
/* ข้อความวิดีโอจากเรนะในแชท: หน้าเรนะ + บับเบิลที่มีคลิป · ระหว่างคลิปเปิดอยู่ วงรอบหน้าเรืองชมพู */
/* คลิปอยู่กลางหน้า · พี่อาร์มสั่ง 10 ต.ค. · เลื่อนซ้ายครึ่งหนึ่งของ (หน้าเรนะ 44 + ช่องว่าง 12) ให้ตัวคลิปตรงกลางพอดี */
.msg.vmsg { grid-template-columns: 44px minmax(0, 1fr); width: 380px; max-width: 100%; margin-inline: auto; justify-self: center; align-self: center; position: relative; left: -28px; }
.msg.vmsg:has(.vframe:not([style*="9/16"])) { width: 616px; }
@media (max-width: 560px) { .msg.vmsg, .msg.vmsg:has(.vframe) { grid-template-columns: 36px minmax(0, 1fr); width: auto; margin-inline: 0; justify-self: stretch; align-self: stretch; left: 0; } }
.vmsg .bub.vbub { padding: 10px; justify-self: start; width: min(324px, 100%); }   /* กว้างเท่าคลิปแนวตั้ง เหมือนส่งคลิปในแชท */
.vmsg .bub.vbub:has(.vframe:not([style*="9/16"])) { width: min(560px, 100%); }
.vbub .v-intro { margin: 4px 8px 10px; }
.vbub .video-box .vframe { border-radius: 18px 18px 18px 6px; max-height: none; }
.vbub .video-box .vframe[style*="9/16"] { width: 100%; height: auto; margin: 0; }
/* คลิปที่ดูแล้ว: ยุบเป็นบับเบิลเล็ก + คำพูดพับเก็บ */
.vpast .bub { justify-self: start; padding: 10px 14px; }
.v-tr { margin: 8px 2px 0; font-size: .92rem; }
.v-tr summary { cursor: pointer; color: var(--pink); font-weight: 600; list-style: none; }
.v-tr summary::-webkit-details-marker { display: none; }
.v-tr p { margin: 8px 0 0; color: var(--muted); line-height: 1.7; }
.vbub .v-cap { display: block; margin: 8px 6px 0; font-size: .78rem; color: var(--muted); }
/* โฟกัสอยู่ในคลิป (ปุ่มแคปหลุดไปที่ iframe) → เบลอเนื้อหาอื่นในหน้าเรียน/สอบ (shield.js ใส่ class) */
.iframe-focus .stage > :not(.vmsg):not(.exam-video), .iframe-focus .exam-video ~ * { filter: blur(8px) !important; transition: filter .2s; }   /* !important ชนะแอนิเมชัน rise ของการ์ด */
/* คำพูดในคลิปเป็นบับเบิลทีละท่อน: จอกว้างอยู่ข้างคลิป (สูงเท่าคลิป เลื่อนในกรอบ) · มือถืออยู่ใต้คลิป */
.msg.vmsg.has-lines { grid-template-columns: 44px 324px 300px; width: 692px; left: 0; align-items: stretch; }
.msg.vmsg.has-lines > .av { align-self: end; }
.vlines { contain: size; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 4px 4px 0; scroll-behavior: smooth; }
.vlines .v-hint { margin: auto 0 4px; }
.vlines .v-read { align-self: flex-start; }
.vlines .vline { animation: rise .45s var(--ease) both; }
.vlines .vline .bub { background: var(--card-solid); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 10px 14px; box-shadow: var(--shadow); font-size: .95rem; line-height: 1.6; }
.vlines .vline .bub p { margin: 0; }
.vlines .vline:last-child .bub { border-color: var(--pink2); }
.vlines.done .vline:last-child .bub { border-color: var(--line); }
@media (max-width: 840px) {
  .msg.vmsg.has-lines { grid-template-columns: 36px minmax(0, 1fr); width: auto; margin-inline: 0; justify-self: stretch; left: 0; }
  .vlines { grid-column: 2; grid-row: 2; contain: none; overflow: visible; padding: 0; }
  .msg.vmsg.has-lines > .av { grid-row: 1; }
}
.vmsg.live .av { animation: avlive 1.3s ease-in-out infinite alternate; }
@keyframes avlive { from { box-shadow: 0 0 0 2px var(--card-solid), 0 0 0 4px var(--pink2); } to { box-shadow: 0 0 0 2px var(--card-solid), 0 0 0 7px color-mix(in srgb, var(--pink2) 55%, transparent), 0 0 18px var(--pink2); } }
@media (prefers-reduced-motion: reduce) { .vmsg.live .av { animation: none; } }
.video-box figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }

.act-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.feedback { flex-basis: 100%; border-radius: 14px; padding: 12px 16px; font-size: .95rem; animation: rise .4s var(--ease) both; }
.feedback.ok { background: var(--ok2); }
.feedback.no { background: var(--bad2); }
.feedback b { display: block; }
.continue { position: sticky; bottom: 16px; z-index: 15; display: flex; justify-content: center; padding-top: 4px; }
.continue .btn { min-width: 220px; box-shadow: var(--shadow-lg); }

.finish { text-align: center; padding: 32px 22px; }
.finish .big { font-size: 3.4rem; line-height: 1; margin-bottom: 8px; }
.finish .stats { display: flex; justify-content: center; gap: 12px; margin: 18px 0; flex-wrap: wrap; }
.finish .stats div { background: var(--card-solid); border: 1px solid var(--line); border-radius: 16px; padding: 12px 18px; min-width: 110px; }
.finish .stats b { display: block; font-size: 1.6rem; color: var(--pink); }
.finish .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 900; }

/* แบบทดสอบ */
.exam-intro h1 { font-size: 1.7rem; }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.qnav button { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card-solid); color: var(--ink); font: 600 .85rem var(--f-body); cursor: pointer; }
.qnav button.answered { background: color-mix(in srgb, var(--lav2) 55%, var(--card-solid)); border-color: var(--lav); }
.qnav button.cur { border-color: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink2) 40%, transparent); }
.qnav button.right { background: var(--ok2); border-color: var(--ok); }
.qnav button.wrong { background: var(--bad2); border-color: var(--bad); }
.exam-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ใบประกาศ */
.cert-page { padding-block: 32px 72px; display: grid; gap: 18px; justify-items: center; }
.verify-badge { padding: 10px 18px; border-radius: 999px; font-weight: 600; background: var(--ok2); color: var(--ok); }
.verify-badge.bad { background: var(--bad2); color: var(--bad); }
/* ใบประกาศ: กระดาษงาช้าง · กรอบทองคู่ + ลายมุม · ลายกิโยเช่จาง ๆ · ตราประทับพาสเทล · QR ตรวจสอบ (ขนาดเป็น cqw ให้สัดส่วนคงที่ทุกจอและตอนพิมพ์) */
.certificate { --gold: #b8935a; --gold2: rgba(184, 147, 90, .45); width: min(1040px, 100%); aspect-ratio: 1.414; color: #2a2238; border-radius: 6px; padding: 1.8cqw; box-shadow: var(--shadow-lg); container-type: inline-size;
  background-color: #fffcf7; background-image: radial-gradient(ellipse at 0 0, rgba(245, 163, 199, .30), transparent 42%), radial-gradient(ellipse at 100% 100%, rgba(190, 175, 245, .38), transparent 46%), radial-gradient(ellipse at 100% 0, rgba(255, 226, 196, .35), transparent 34%);
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cert-in { position: relative; height: 100%; border: .32cqw double var(--gold); display: flex; flex-direction: column; align-items: center; text-align: center; padding: 3.4cqw 7cqw 2cqw; gap: .5cqw; isolation: isolate; overflow: hidden; }
.cert-in::before { content: ""; position: absolute; inset: .9cqw; border: 1px solid var(--gold2); pointer-events: none; }
.cert-corner { position: absolute; width: 8.5cqw; color: var(--gold); line-height: 0; pointer-events: none; }
.cert-corner svg { width: 100%; height: auto; }
.cert-corner.tl { top: .45cqw; left: .45cqw; } .cert-corner.tr { top: .45cqw; right: .45cqw; transform: scaleX(-1); }
.cert-corner.bl { bottom: .45cqw; left: .45cqw; transform: scaleY(-1); } .cert-corner.br { bottom: .45cqw; right: .45cqw; transform: scale(-1); }
.cert-guil { position: absolute; z-index: -1; width: 46cqw; top: 50%; left: 50%; transform: translate(-50%, -46%); color: #c9a6d6; opacity: .22; pointer-events: none; }
.cert-head { display: grid; justify-items: center; gap: .2cqw; }
.cert-brand { display: flex; align-items: center; gap: 1cqw; font-family: var(--f-script); font-size: 2.1cqw; font-style: italic; color: #c94f86; }
.cert-brand img { width: 4.2cqw; height: 4.2cqw; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 .2cqw #fff, 0 0 0 .32cqw var(--gold2); }
.cert-title { margin: .6cqw 0 0; font-family: var(--f-head); font-weight: 700; font-size: 4.3cqw; line-height: 1.25; letter-spacing: .04em; color: #3a2c4d; }
.cert-kicker { margin: 0; font-family: var(--f-script); font-style: italic; font-size: 1.8cqw; color: var(--gold); letter-spacing: .06em; }
.cert-rule { display: flex; align-items: center; gap: 1cqw; width: 30cqw; margin: .6cqw 0 .9cqw; }
.cert-rule i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.cert-rule i:last-child { transform: scaleX(-1); }
.cert-rule b { width: .9cqw; height: .9cqw; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 0 .3cqw #fffcf7, 0 0 0 .4cqw var(--gold2); }
.cert-small { font-size: 1.55cqw; color: #5d5270; margin: 0; }
.cert-name { font-family: var(--f-head); font-weight: 700; font-size: 5.4cqw; line-height: 1.35; margin: .2cqw 0 .3cqw; padding: 0 3cqw .5cqw; border-bottom: 1px solid var(--gold2);
  background: linear-gradient(100deg, #d9558f, #a274e0 55%, #6f9fe0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cert-course { font-family: var(--f-head); font-weight: 600; font-size: 2.7cqw; line-height: 1.35; margin: .3cqw 0 0; color: #2a2238; }
.cert-meta { list-style: none; display: flex; margin: 1.4cqw 0 0; padding: 0; }
.cert-meta li { display: grid; gap: .1cqw; padding: 0 2.6cqw; }
.cert-meta li + li { border-left: 1px solid var(--gold2); }
.cert-meta small { font-size: 1.05cqw; letter-spacing: .12em; color: #8d7fa0; }
.cert-meta b { font-size: 1.6cqw; font-weight: 600; color: #3a2c4d; }
.cert-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; width: 100%; margin-top: auto; }
.cert-foot .sign { justify-self: start; display: grid; gap: .15cqw; text-align: center; font-size: 1.3cqw; }
.cert-foot .sig { font-family: var(--f-script); font-style: italic; font-size: 3.6cqw; color: #c94f86; border-bottom: 1px solid var(--gold); padding: 0 3.4cqw; line-height: 1.15; }
.cert-foot small { color: #857b95; font-size: 1.05cqw; }
.cert-seal { width: 11cqw; height: auto; filter: drop-shadow(0 .4cqw .6cqw rgba(120, 70, 150, .25)); }
.cert-seal text { font-family: var(--f-body); }
.cert-seal .cs-r { font-family: var(--f-script); font-style: italic; }
.cert-foot .code { justify-self: end; display: flex; align-items: center; gap: 1.2cqw; text-align: left; font-size: 1.3cqw; }
.cert-foot .code > div:last-child { display: grid; gap: .1cqw; }
.cert-foot .code b { font-size: 1.7cqw; letter-spacing: .08em; }
.cert-qr { width: 7.6cqw; aspect-ratio: 1; padding: .35cqw; background: #fff; border: 1px solid var(--gold2); border-radius: .5cqw; line-height: 0; }
.cert-qr svg { width: 100%; height: 100%; }
.cert-qr svg path, .cert-qr svg rect[fill="black"] { fill: #2a2238; }
.cert-url { margin: .7cqw 0 0; font-size: .95cqw; color: #a197b2; letter-spacing: .02em; }
.cert-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* หลังบ้าน */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 20px; }
.tabs a { text-decoration: none; padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink2); font-size: .92rem; }
.tabs a[aria-current="page"] { background: var(--grad); color: #fff; border-color: transparent; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 28px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.kpi b { display: block; font-size: 1.8rem; font-family: var(--f-head); }
.kpi span { color: var(--muted); font-size: .88rem; }
.tbl-wrap { overflow-x: auto; margin-bottom: 28px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-weight: 600; background: color-mix(in srgb, var(--lav2) 25%, transparent); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.bar { display: inline-block; width: 80px; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--lav2) 55%, transparent); position: relative; overflow: hidden; vertical-align: middle; }
.bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--grad); }
.my-list { display: grid; gap: 14px; }
.my-item { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); }
.my-item.has-thumb { grid-template-columns: auto auto 1fr auto; }
.my-thumb { width: 160px; height: 90px; object-fit: cover; border-radius: 14px; display: block; }
@media (max-width: 640px) {
  .my-item.has-thumb { grid-template-columns: auto 1fr; }
  .my-item.has-thumb .my-thumb { grid-column: 1 / -1; width: 100%; height: auto; aspect-ratio: 16 / 9; }
}
.my-acts { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.my-acts .btn { justify-content: center; }
@media (max-width: 640px) { .my-acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; } }
.my-item h2 { font-size: 1.2rem; margin: 0; }
.my-item p { margin: 0; }

/* ท้ายเว็บ */
.foot { text-align: center; padding: 28px var(--gut) 40px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
.foot p { margin: 0 0 6px; }
.foot-note { font-size: .78rem; }

/* ---------- ระบบกันแคป (shield) ---------- */
.shielded .stage, .shielded .lesson-head { -webkit-touch-callout: none; }
.shielded textarea { -webkit-user-select: text; user-select: text; }
.shielded img { -webkit-user-drag: none; pointer-events: none; }
/* ลายน้ำนิ่ง (ความจาง/มุม/ขนาด มาจากหลังบ้าน) */
.wm { position: fixed; inset: -50%; z-index: 800; pointer-events: none; opacity: .05; background-repeat: repeat; }
.wm-corner { position: fixed; z-index: 801; pointer-events: none; font-size: 11px; font-weight: 600; color: var(--ink2); opacity: .25; white-space: nowrap; max-width: 70vw; overflow: hidden; text-overflow: ellipsis; }
.wm-corner.pos-br { right: 12px; bottom: 10px; } .wm-corner.pos-bl { left: 12px; bottom: 10px; }
.wm-corner.pos-tr { right: 12px; top: calc(var(--nav-h) + 8px); } .wm-corner.pos-tl { left: 12px; top: calc(var(--nav-h) + 8px); }
.no-select .stage, .no-select .lesson-head { -webkit-user-select: none; user-select: none; }

/* เอฟเฟกต์แบบ Rena's Journal */
.sparkles { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.glow { position: fixed; z-index: -1; width: 520px; height: 520px; left: 0; top: 0; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(245, 163, 199, .22), rgba(180, 162, 245, .12) 40%, transparent 70%);
  transform: translate3d(var(--gx, -999px), var(--gy, -999px), 0) translate(-50%, -50%); transition: opacity .6s; }
.has-pointer .glow { opacity: 1; }
.nav.scrolled::before { box-shadow: 0 6px 24px -18px rgba(60, 30, 80, .5); }
[data-tilt] { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s var(--ease), box-shadow .4s var(--ease); }
[data-tilt]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .28), transparent 55%); }
[data-tilt]:hover::after { opacity: 1; }
[data-magnet] { transition: transform .25s var(--ease); }

/* หน้าขาย */
.sales-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 56px); align-items: center; padding-block: clamp(28px, 6vw, 72px); }
.sh-poster { margin: 0; position: relative; justify-self: center; max-width: 420px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.sh-poster img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
/* สมัคร + ชำระเงิน */
.pay-wrap { padding-top: 28px; padding-bottom: 48px; }
.order-head { text-align: center; max-width: 720px; margin: 0 auto 18px; }
.order-head h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
.pay-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; max-width: 980px; margin: 0 auto; align-items: start; }
@media (max-width: 820px) { .pay-grid { grid-template-columns: 1fr; } }
.pay-card { position: relative; border-radius: 28px; padding: 26px 24px 22px; color: #fff; overflow: hidden;
  background: linear-gradient(140deg, #0f7a4a 0%, #13a35f 48%, #3fc488 100%); box-shadow: 0 22px 50px rgba(19, 120, 80, .35); }
.pay-card::before { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.12); }
.pay-card::after { content: ""; position: absolute; left: -40px; bottom: -70px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.pc-head { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.pc-bank { font-weight: 700; font-size: 1.15rem; letter-spacing: .3px; }
.pc-chip { padding: 4px 14px; border-radius: 999px; background: rgba(255,255,255,.2); font-size: .85rem; }
.pc-qr { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px auto 16px; }
.pc-qr [data-qr] { width: 220px; height: 220px; padding: 10px; border-radius: 18px; background: #fff; }
.pc-qr [data-qr] svg { width: 100%; height: 100%; display: block; }
.pc-qr small { opacity: .9; }
.pc-rows { position: relative; display: grid; gap: 10px; }
.pc-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.14); }
.pc-row span { font-size: .85rem; opacity: .9; }
.pc-row b { font-size: 1.02rem; word-break: break-word; }
.pc-amt { font-size: 1.6rem !important; letter-spacing: .5px; }
.pc-amt small { font-size: .9rem; }
.pc-no { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem !important; letter-spacing: 1px; }
.pc-amt, .pc-no { white-space: nowrap; }
@media (max-width: 520px) {
  .pc-row { grid-template-columns: 1fr auto; row-gap: 2px; }
  .pc-row span { grid-column: 1 / -1; }
  .pay-card { padding: 22px 16px 18px; }
}
.pc-row .btn { color: #fff; border-color: rgba(255,255,255,.5); background: transparent; }
.pc-note { position: relative; margin: 14px 2px 0; font-size: .9rem; opacity: .95; }
.slip-card h2 { margin-top: 0; }
.pay-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-steps li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: .88rem; }
.pay-steps b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad); font-size: .85rem; }
@media (max-width: 520px) { .pay-steps { grid-template-columns: 1fr; } }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .form .two { grid-template-columns: 1fr; } }
.form .hint { margin: -4px 0 4px; font-size: .8rem; color: var(--ink2); }
/* คำนำหน้า + ชื่อเล่น */
.callname { border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 10px; margin: 6px 0 4px; display: grid; gap: 10px; }
.callname legend { padding: 0 6px; font-weight: 600; }
.callname legend small { font-weight: 400; color: var(--ink2); }
.cn-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cn-label { font-size: .9rem; color: var(--ink2); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: .92rem; transition: all .2s; }
.seg-opt input:checked + span { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(217, 85, 143, .3); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--pink); outline-offset: 2px; }
.profile-box { margin: 10px 0 22px; }
.profile-box summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.profile-box form { margin-top: 14px; }
.cn-preview { margin: 0; font-size: .9rem; color: var(--ink2); }
.cn-preview b { color: var(--pink); font-size: 1.05rem; }
.nopaste { display: block; margin-top: 4px; color: var(--bad); font-size: .8rem; }
.reslip { margin: 14px auto; max-width: 420px; text-align: left; }
.reslip summary { cursor: pointer; color: var(--ink2); font-size: .9rem; }
.file-drop input[type=file] { margin-top: 8px; padding: 18px; border: 2px dashed var(--line); border-radius: 16px; width: 100%; background: transparent; }
.mini-steps { margin: 16px 0 8px; padding-left: 20px; display: grid; gap: 4px; color: var(--ink2); font-size: .92rem; }
.order-card .oc-main { display: grid; grid-template-columns: 1fr 180px; gap: 18px; align-items: start; }
.order-card .oc-code { margin: 0 0 6px; }
.oc-slip img { width: 180px; max-height: 320px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
@media (max-width: 640px) { .order-card .oc-main { grid-template-columns: 1fr; } }
.tabs.sub a { font-size: .85rem; }

/* หลังบ้าน · แชท LINE */
.ticks.plain li { padding-left: 0; }
.ticks.plain li::before { content: none; }
.key-once { border: 2px dashed var(--pink); }
.keybox { display: inline-block; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--line) 40%, transparent); font-size: .9rem; word-break: break-all; user-select: all; }
.check2 { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.chat-card { margin-bottom: 18px; }
.chat-log { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--line) 30%, transparent); margin-bottom: 12px; }
.chat-log .b { margin: 0; display: flex; flex-direction: column; max-width: 80%; }
.chat-log .b span { padding: 8px 12px; border-radius: 14px; font-size: .92rem; line-height: 1.5; }
.chat-log .b small { font-size: .7rem; color: var(--ink2); margin-top: 2px; }
.chat-log .them { justify-self: start; }
.chat-log .them span { background: var(--card); border: 1px solid var(--line); }
.chat-log .me { justify-self: end; align-items: flex-end; }
.chat-log .me span { background: #06c755; color: #fff; }
.btn.xs { padding: 3px 10px; font-size: .78rem; min-height: 0; }
.joke { margin: 6px 0 4px; padding: 12px 16px; border-left: 4px solid var(--pink); border-radius: 0 14px 14px 0; background: color-mix(in srgb, var(--pink2) 16%, transparent); font-size: 1rem; color: var(--ink); font-style: italic; }
.buy-box { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 12px; box-shadow: var(--shadow); max-width: 520px; }
.buy-box p { margin: 0; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.price b { font-family: var(--f-head); font-size: 2.3rem; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.price b i { font-style: normal; font-size: 1rem; }
.price s { color: var(--muted); font-size: 1.05rem; }
.price small { flex-basis: 100%; color: var(--muted); font-size: .85rem; }
.p-tag { font-size: .8rem; font-weight: 700; color: #fff; background: var(--pink); padding: 3px 12px; border-radius: 999px; align-self: center; }
.line-btn { background: #06c755; color: #fff; box-shadow: 0 10px 26px -12px rgba(6, 199, 85, .7); font-size: 1.05rem; padding: 14px 26px; justify-self: start; }
.line-btn:hover { background: #05b34c; transform: translateY(-1px); }
.line-btn.disabled { background: var(--card-solid); color: var(--muted); border-color: var(--line); box-shadow: none; cursor: default; }
.demo-box { text-align: center; margin-bottom: clamp(32px, 6vw, 64px); }
.demo-box .act { text-align: left; margin: 14px 0 8px; }
/* ตัวอย่างการเรียน "เล่นกับเรนะ 1 นาที" (หน้าแรก + หน้าขาย) */
.demo { text-align: left; display: grid; gap: 14px; margin: 18px 0 10px; }
.demo-stage { display: grid; gap: 16px; }
.demo .row { display: flex; flex-wrap: wrap; gap: 10px; }
.demo-start, .demo-end { padding-left: 56px; }
.demo .act { margin: 0; }
.demo-ab { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.demo-col { display: grid; gap: 8px; align-content: start; }
.demo-opt { flex-direction: column; align-items: flex-start; gap: 6px; height: 100%; }
.demo-prompt { font-size: .92rem; color: var(--ink2); }
.demo-res { border: 1px dashed var(--line); border-radius: 14px; padding: 10px 14px; background: color-mix(in srgb, var(--lav2) 20%, transparent); font-size: .94rem; animation: rise .5s var(--ease) both; }
.demo-res[hidden] { display: none; }
.demo-res p { margin: 4px 0 0; }
.demo-res .ai-tag { margin: 0; }
.demo-chat { display: grid; gap: 10px; margin-top: 10px; }
.dc-me { justify-self: end; max-width: 85%; padding: 10px 14px; border-radius: 18px 18px 6px 18px; background: color-mix(in srgb, var(--pink2) 30%, var(--card-solid)); }
.dc-ai { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; background: var(--card-solid); }
.dc-who { font-size: .8rem; color: var(--muted); }
.demo-line { text-align: left; font: inherit; color: var(--ink); background: transparent; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; transition: border-color .2s, background-color .2s; }
.demo-line:hover:not([disabled]) { border-color: var(--pink2); }
.demo-line.right { border-color: var(--ok); background: var(--ok2); }
.demo-line.wrong { border-color: var(--bad); background: var(--bad2); animation: shake .4s; }
.demo .speaking { border-color: var(--pink2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink2) 35%, transparent), var(--shadow); }
/* ปุ่มฟังเรนะทักทาย: เกาะขอบล่างรูปเรนะ · วงกระเพื่อม + นิ้วชี้ชวนกด (หยุดเมื่อกดครั้งแรก) */
.has-voice { position: relative; padding-bottom: 30px; }
.sh-art { justify-self: center; width: 100%; max-width: 420px; }
.sh-art .sh-poster { max-width: none; }
.has-voice > .hi-voice { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 2; }
.has-voice > .hi-voice:hover { transform: translateX(-50%) translateY(-2px); }
.hi-voice:not(.has-voice > *):hover { transform: translateY(-2px); }
.hi-voice { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 7px; border-radius: 999px; border: 1px solid var(--pink2); background: var(--card-solid); color: var(--ink); font: inherit; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s var(--ease); }
.hi-voice:hover, .hi-voice.on { box-shadow: 0 0 0 4px color-mix(in srgb, var(--pink2) 30%, transparent), var(--shadow); }
.hi-voice .hv-ico { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.05rem; background: linear-gradient(135deg, var(--pink2), var(--lav2)); }
.hi-voice .hv-txt { display: grid; text-align: left; line-height: 1.2; }
.hi-voice .hv-t { font-weight: 700; font-size: .95rem; }
.hi-voice small { color: var(--muted); font-size: .68rem; }
.hi-voice .hv-finger { font-size: 1.25rem; display: none; }
.hi-voice.invite .hv-finger { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .hi-voice.invite .hv-ico::before, .hi-voice.invite .hv-ico::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--pink); opacity: 0; animation: hv-ripple 2s ease-out infinite; }
  .hi-voice.invite .hv-ico::after { animation-delay: 1s; }
  .hi-voice.invite .hv-finger { animation: hv-point 1.1s ease-in-out infinite; }
  .hi-voice.on .hv-ico { animation: hv-beat .9s ease-in-out infinite; }
  /* ทุกจุดที่มีเสียง (พี่อาร์มสั่ง 5 ต.ค.): ปุ่มลองฟังกระเพื่อม · ปุ่มในบับเบิลที่กำลังพูด + ปุ่ม 🎧 บนแถบ = วงคลื่นเสียง */
  .v-try, .v-btn[data-mode="stop"], .v-btn[data-mode="resume"], .v-tog.live { animation: v-wave 1.6s ease-out infinite; }
}
@keyframes v-wave { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pink) 55%, transparent); } 100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--pink) 0%, transparent); } }
.v-gate .hi-voice, .demo .hi-voice { font-size: 1rem; }
@keyframes hv-ripple { 0% { transform: scale(1); opacity: .75; } 100% { transform: scale(2.3); opacity: 0; } }
@keyframes hv-point { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-7px); } }
@keyframes hv-beat { 50% { transform: scale(1.08); } }
@media (max-width: 640px) { .demo-ab { grid-template-columns: 1fr; } .demo-start, .demo-end { padding-left: 0; } }
.sales-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: clamp(32px, 6vw, 64px); }
.muted-h { font-size: 1rem; color: var(--muted); margin-top: 16px; }
.crosses { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.crosses li { padding-left: 30px; position: relative; color: var(--muted); font-size: .95rem; }
.crosses li::before { content: "✕"; position: absolute; left: 4px; top: 0; color: var(--muted); font-weight: 700; }
.faq { margin-block: clamp(32px, 6vw, 64px); display: grid; gap: 10px; }
.faq details { padding: 14px 18px; animation: none; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--ink2); }
.buy-final { padding: clamp(28px, 5vw, 48px); margin-bottom: 64px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); display: grid; justify-items: center; gap: 8px; }
.buy-final .price { justify-content: center; }
.buy-final .line-btn { justify-self: center; }
.cc-price { font-size: .95rem; color: var(--ink2); }
.cc-price b { color: var(--pink); font-size: 1.15rem; }
.cc-price s { color: var(--muted); font-size: .85rem; }
@media (max-width: 900px) { .sales-hero, .sales-grid { grid-template-columns: 1fr; } .sh-poster { order: -1; max-width: 340px; } .sh-art { order: -1; max-width: 340px; } }

/* ตัวอย่างลายน้ำในหลังบ้าน */
.wm-admin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.wm-prev { position: sticky; top: calc(var(--nav-h) + 12px); height: 360px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #fbf6f4; color: #2a2238; }
.wm-prev.dark { background: #140f1d; color: #f4eef8; }
.wm-prev .wm-prev-layer { position: absolute; inset: -50%; background-repeat: repeat; pointer-events: none; }
.wm-prev .wm-corner { position: absolute; color: inherit; }
.wm-prev .wm-corner.pos-tr, .wm-prev .wm-corner.pos-tl { top: 10px; }
.wm-prev-content { position: relative; padding: 18px; font-size: .9rem; line-height: 1.7; }
.wm-prev-content b { display: block; font-size: 1.05rem; margin-bottom: 6px; }
.range-row { display: grid; grid-template-columns: 1fr 52px; gap: 10px; align-items: center; }
.range-row input[type=range] { padding: 0; accent-color: var(--pink); }
.range-row output { font-weight: 700; color: var(--pink); text-align: right; }
.form fieldset { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 12px; margin: 0; }
.form legend { font-weight: 700; padding: 0 6px; }
.form .check2 { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.form .check2 input { width: 18px; height: 18px; accent-color: var(--pink); }
@media (max-width: 860px) { .wm-admin { grid-template-columns: 1fr; } .wm-prev { position: relative; top: 0; height: 260px; } }
.blackout { position: fixed; inset: 0; z-index: 2000; background: #000; color: #fff; display: none; place-items: center; text-align: center; padding: 24px; }
.blackout p { max-width: 420px; color: #bbb; font-size: .95rem; }
.blackout b { display: block; color: #fff; font-size: 1.2rem; margin-bottom: 6px; }
.shield-on .blackout { display: grid; }
.shield-on main, .shield-on .wm, .shield-on .wm-corner { visibility: hidden; }

/* หน้าขาย · สมัครแล้วได้อะไรบ้าง */
.get-box { margin-top: 28px; margin-bottom: 28px; }
.get-box h2 { margin-top: 0; }
.pp-sample { margin-top: 12px; }
.pp-sample summary { cursor: pointer; font-weight: 600; color: var(--pink); }
.pp-text { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--line) 30%, transparent); margin: 6px 0; }

/* ชุดเครื่องมือกลับบ้าน (?p=kit) · ข้อความเลือก/คัดลอกได้ · พิมพ์เป็น A4 แนวตั้ง */
.kit { -webkit-user-select: text; user-select: text; }
.kit h2 { font-size: 1.25rem; margin: 1.6em 0 .6em; }
.kit-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.kit-item { margin: 0 0 14px; }
.kit-item h3 { font-size: 1.02rem; margin: .2em 0 .6em; }
.kit-item > p.small { margin: 0; }
.kit-ans { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--line) 30%, transparent); margin: 0 0 10px; overflow-wrap: anywhere; }

@media print {
  html[data-page="kit"] body { page: kit; background: #fff; }
  html[data-page="kit"] .kit-actions, html[data-page="kit"] .kit [data-copy] { display: none !important; }
  html[data-page="kit"] .kit-item { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; background: #fff !important; }
  html[data-page="kit"] .kit, html[data-page="kit"] .kit * { color: #1d1a22 !important; }   /* โหมดมืด: ตัวอักษรสว่างบนกระดาษขาวอ่านไม่ออก */
  html[data-page="kit"] .kit-ans { background: #f3f0f5 !important; }
  html[data-page="kit"] .sparkles, html[data-page="kit"] .glow { display: none !important; }
  @page kit { size: A4 portrait; margin: 12mm; }
  body.shielded > * { display: none !important; }
  body.shielded::after { content: "เนื้อหาคอร์สนี้สงวนสิทธิ์ ไม่อนุญาตให้พิมพ์หรือบันทึก"; display: block; padding: 40px; font-size: 18pt; }
  .nav, .foot, .aurora, .cert-actions, .verify-badge, .skip { display: none !important; }
  html[data-page="cert"] body { background: #fff; }
  html[data-page="cert"] .certificate { box-shadow: none; width: 100%; }
  @page { size: A4 landscape; margin: 8mm; }
}

/* จอเล็ก */
@media (max-width: 900px) {
  .hero, .course-hero, .course-body { grid-template-columns: 1fr; }
  .hero-art { max-width: 300px; order: -1; }
  .features { grid-template-columns: 1fr; }
  .steps-row { grid-template-columns: 1fr 1fr; }
  .outcomes { position: static; }
  .course-stat { justify-self: start; display: flex; align-items: center; gap: 16px; padding: 14px 20px; }
  .course-stat p { margin: 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .steps-row { grid-template-columns: 1fr; }
  .row-form { flex-direction: column; }
  .bubble.b1 { left: -8px; } .bubble.b2 { right: -6px; }
  .pair { grid-template-columns: 1fr; gap: 4px; }
  .msg { grid-template-columns: 36px 1fr; gap: 8px; }
  .msg .av { width: 36px; height: 36px; }
  .my-item { grid-template-columns: auto 1fr; }
  .my-item .btn { grid-column: 1 / -1; }
  .nav-tools .btn.sm { padding: 7px 12px; }
  .certificate { aspect-ratio: auto; padding: 8px; }
  .cert-in { padding: 34px 18px 22px; gap: 6px; border-width: 3px; }
  .cert-in::before { inset: 5px; }
  .cert-corner { width: 46px; }
  .cert-guil { width: 120%; }
  .cert-brand { font-size: 1.05rem; } .cert-brand img { width: 34px; height: 34px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--gold2); }
  .cert-title { font-size: 1.55rem; } .cert-kicker { font-size: .85rem; }
  .cert-rule { width: 60%; gap: 6px; margin: 4px 0 8px; } .cert-rule b { width: 7px; height: 7px; box-shadow: 0 0 0 3px #fffcf7, 0 0 0 4px var(--gold2); }
  .cert-small { font-size: .85rem; }
  .cert-name { font-size: 1.75rem; padding: 0 8px 4px; } .cert-course { font-size: 1.1rem; }
  .cert-meta { flex-wrap: wrap; justify-content: center; row-gap: 8px; margin-top: 12px; }
  .cert-meta li { padding: 0 12px; } .cert-meta li:last-child { flex-basis: 100%; border-left: 0; } .cert-meta small { font-size: .65rem; } .cert-meta b { font-size: .85rem; }
  .cert-foot { grid-template-columns: 1fr; justify-items: center; gap: 16px; margin-top: 20px; }
  .cert-foot .sign, .cert-foot .code { justify-self: center; font-size: .8rem; } .cert-foot .sig { font-size: 1.7rem; padding: 0 22px; } .cert-foot small { font-size: .7rem; }
  .cert-foot .code { gap: 10px; } .cert-foot .code b { font-size: .95rem; }
  .cert-seal { width: 82px; order: -1; } .cert-qr { width: 70px; padding: 3px; border-radius: 4px; }
  .cert-url { font-size: .65rem; word-break: break-all; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* เลขที่ใบสมัครตัวใหญ่ (หน้า order · พี่อาร์มขอ 5 ต.ค.) */
.order-ref { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; margin: 2px auto 16px; padding: 14px 26px 16px; border-radius: 18px; border: 2px dashed var(--pink2); background: color-mix(in srgb, var(--pink2) 12%, transparent); }
.order-ref span { font-size: .9rem; color: var(--muted); }
.order-ref strong { font-size: clamp(2rem, 7vw, 2.8rem); line-height: 1.1; letter-spacing: .08em; color: var(--pink); font-variant-numeric: tabular-nums; -webkit-user-select: all; user-select: all; }

/* ตรวจ QR สลิป (5 ต.ค. 2026) */
.slip-status { margin: -2px 0 6px; padding: 8px 12px; border-radius: 12px; font-size: .85rem; color: var(--ink2); background: color-mix(in srgb, var(--line) 35%, transparent); }
.slip-status.busy { color: var(--muted); }
.slip-status.ok { color: var(--ok); background: var(--ok2); font-weight: 600; }
.slip-status.bad { color: var(--bad); background: var(--bad2); font-weight: 600; }
.file-drop:has(input[data-state=ok]) input[type=file] { border-color: var(--ok); }
.file-drop:has(input[data-state=bad]) input[type=file] { border-color: var(--bad); }
.oc-qr { margin: 6px 0; padding: 8px 12px; border-radius: 12px; font-size: .85rem; line-height: 1.6; }
.oc-qr.ok { background: var(--ok2); }
.oc-qr.warn { background: var(--bad2); }
.oc-qr code { font-size: .8rem; word-break: break-all; }/* หน้าทดสอบสลิป (หลังบ้าน) */
.slipqa { max-width: 720px; }
.slipqa-verdict { display: flex; flex-direction: column; gap: 4px; margin: 14px 0; padding: 14px 16px; border-radius: 14px; font-size: 1.05rem; }
.slipqa-verdict.ok { background: var(--ok2); color: var(--ok); }
.slipqa-verdict.bad { background: var(--bad2); color: var(--bad); }
.slipqa-verdict span { font-size: .85rem; color: var(--ink2); }
.slipqa-tbl th { text-align: left; white-space: nowrap; width: 1%; padding-right: 12px; color: var(--ink2); font-weight: 500; }
.slipqa-tbl td { word-break: break-all; }
.slipqa-qr { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.slipqa-raw { display: block; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--line) 35%, transparent); font-size: .78rem; word-break: break-all; }
/* แสดงในกรอบของ Rena Admin (/rena/admin) · ซ่อนหัว/ท้ายเว็บ (5 ต.ค. 2026) */
html[data-embed] .nav, html[data-embed] .foot, html[data-embed] .skip, html[data-embed] .aurora, html[data-embed] .sparkles, html[data-embed] .glow { display: none !important; }
html[data-embed] body { background: transparent; }
html[data-embed] main { padding-top: 0; }html[data-embed] .admin > h1 { display: none; }
html[data-embed] .wrap.pad.admin { padding-top: 8px; max-width: none; }

/* หน้านโยบาย + โบนัส Prompt pack (5 ต.ค. 2026) */
.policy h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: .3em; }
.policy h2 { font-size: 1.2rem; margin: 1.6em 0 .5em; }
.policy h3 { font-size: 1.02rem; margin: 1.3em 0 .4em; color: var(--pink); }
.policy p, .policy li { line-height: 1.75; }
.policy ul { padding-left: 1.2em; margin: .3em 0 .8em; }
.policy .tbl-wrap { margin: .6em 0 1em; }
.bonus p { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--line) 30%, transparent); -webkit-user-select: text; user-select: text; }
.bonus-card { display: flex; flex-direction: column; gap: 4px; margin: 14px 0; text-decoration: none; color: inherit; border: 1px dashed var(--pink2); }
/* 10 ต.ค. 2026 · แถบขอความยินยอมคุกกี้การตลาด (Meta Pixel · px.js) + ปุ่มลิงก์ท้ายหน้า */
.px-consent { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; width: min(640px, calc(100% - 32px)); box-sizing: border-box; padding: 14px 16px; border-radius: 16px; background: var(--card-solid); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(20, 15, 29, .22); font-size: .9rem; line-height: 1.6; }
.px-consent p { margin: 0 0 10px; color: var(--ink2); }
.px-consent .px-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
