/* TiwTCAS — โทนสดใส อ่านง่าย: พื้นขาวอมม่วง การ์ดมุมมน ฟ้าครามเป็นสีหลัก มาสคอตน้องหมึก
   จอใหญ่ = sidebar · ไอแพดแนวตั้ง = แถบไอคอน · มือถือ = แถบล่าง */
:root {
  --bg: #F5F4FB; --bg2: #FFFFFF; --bg3: #EFEEF8; --fill: rgba(70, 72, 140, .07); --fill2: rgba(70, 72, 140, .14);
  --label: #1B1F3B; --label2: #646A8C; --label3: #A3A7C2; --sep: rgba(40, 42, 100, .09);
  --brand: #4A6CF7; --brand-soft: #E9EEFF; --purple: #8B5CF6;
  --blue: #4A6CF7; --green: #1FBF77; --red: #F2545B; --orange: #FF9B3D; --yellow: #FFC23C; --indigo: #5B5FEF; --teal: #1FB3CC; --pink: #FF6FA4;
  --shadow: 0 1px 2px rgba(30, 32, 90, .04), 0 12px 32px -14px rgba(30, 32, 90, .18); --shadow-lg: 0 24px 60px -20px rgba(30, 32, 90, .3);
  --paper: #FFFFFF; --rule: rgba(60, 64, 140, .09); --r: 22px;
  --font: 'Anuphan', 'IBM Plex Sans Thai', system-ui, -apple-system, sans-serif; --display: 'Mitr', 'Anuphan', system-ui, sans-serif; color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0F1020; --bg2: #191A2E; --bg3: #222439; --fill: rgba(170, 175, 255, .08); --fill2: rgba(170, 175, 255, .16);
  --label: #ECECF8; --label2: #A0A4C8; --label3: #6A6E92; --sep: rgba(255, 255, 255, .08);
  --brand: #6E8BFF; --brand-soft: rgba(110, 139, 255, .16); --blue: #6E8BFF; --green: #36D58C; --red: #FF6B71; --orange: #FFAA55; --yellow: #FFD15C; --purple: #A47BFF; --indigo: #7D80FF; --teal: #3CCBE2; --pink: #FF85B3;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .04); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .6); --paper: #191A2E; --rule: rgba(255, 255, 255, .06); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0F1020; --bg2: #191A2E; --bg3: #222439; --fill: rgba(170, 175, 255, .08); --fill2: rgba(170, 175, 255, .16);
  --label: #ECECF8; --label2: #A0A4C8; --label3: #6A6E92; --sep: rgba(255, 255, 255, .08);
  --brand: #6E8BFF; --brand-soft: rgba(110, 139, 255, .16); --blue: #6E8BFF; --green: #36D58C; --red: #FF6B71; --orange: #FFAA55; --yellow: #FFD15C; --purple: #A47BFF; --indigo: #7D80FF; --teal: #3CCBE2; --pink: #FF85B3;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .04); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .6); --paper: #191A2E; --rule: rgba(255, 255, 255, .06); color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body { position: relative; background: var(--bg); color: var(--label); font: 400 16.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-family: var(--display); font-weight: 500; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 50%, transparent); outline-offset: 2px; border-radius: 10px; }
svg.i { width: 22px; height: 22px; flex: none; }
.mascot { flex: none; overflow: visible; }
.mascot.bob { animation: bob 3.2s ease-in-out infinite; } @keyframes bob { 50% { transform: translateY(-6px); } }
.mascot.pop { animation: mpop .5s cubic-bezier(.2, .9, .3, 1.5); } @keyframes mpop { from { transform: scale(.6) rotate(-8deg); opacity: 0; } }

/* ── โครงหน้า ── */
.layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px 16px; background: var(--bg2); border-right: 1px solid var(--sep); overflow-y: auto; z-index: 20; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--label); font: 600 21px var(--display); letter-spacing: -.01em; }
.side .logo img { width: 36px; height: 36px; border-radius: 11px; }
.side .logo b { font-weight: 600; } .side .logo b span, .brand span, .topbar .mlogo span { color: var(--brand); }
.side .nav { display: flex; flex-direction: column; gap: 2px; }
.side .nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; color: var(--label2); font-weight: 500; font-size: 15.5px; transition: background .15s, color .15s; position: relative; }
.side .nav a .ni { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--fill); color: var(--label2); transition: all .15s; flex: none; }
.side .nav a .ni svg { width: 20px; height: 20px; }
.side .nav a:hover { background: var(--fill); color: var(--label); }
.side .nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; } .side .nav a.on .ni { background: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px var(--brand); }
.side .nav .live { position: absolute; left: 34px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg2); }
.side .grow { flex: 1; min-height: 16px; }
.plan-card { position: relative; overflow: hidden; display: block; padding: 14px 14px 14px 16px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #5B7BFF, #8B5CF6); box-shadow: 0 14px 30px -14px #6B5CF6; min-height: 76px; }
.plan-card b { display: block; font: 500 16px var(--display); } .plan-card small { display: block; font-size: 13px; opacity: .88; max-width: 130px; line-height: 1.35; margin-top: 2px; }
.plan-card .mascot { position: absolute; right: -4px; bottom: -14px; }
.me-row { display: flex; align-items: center; gap: 10px; padding: 12px 8px 2px; margin-top: 10px; border-top: 1px solid var(--sep); color: var(--label); }
.me-row .av { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #FFB86B, #FF6FA4); color: #fff; font-weight: 700; flex: none; }
.me-row span { flex: 1; min-width: 0; } .me-row b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .me-row small { color: var(--label2); font-size: 12.5px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: env(safe-area-inset-top) 24px 0; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.line { border-bottom-color: var(--sep); }
.topbar .nb { min-width: 40px; height: 40px; display: inline-flex; align-items: center; gap: 4px; color: var(--label); background: var(--bg2); border: 0; border-radius: 13px; cursor: pointer; padding: 0 12px 0 8px; font-weight: 500; font-size: 15px; white-space: nowrap; box-shadow: var(--shadow); }
.topbar .nb svg { width: 20px; height: 20px; }
.topbar .title { font: 500 17px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.topbar.line .title, .topbar.always .title { opacity: 1; }
.topbar .sp { flex: 1; }
.topbar .mlogo { display: none; align-items: center; gap: 8px; font: 600 19px var(--display); color: var(--label); } .topbar .mlogo img { width: 32px; height: 32px; border-radius: 10px; }
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px 32px 70px; }
.phead { display: flex; align-items: center; gap: 14px; margin: 4px 0 22px; flex-wrap: wrap; }
.phead h1 { font-size: clamp(26px, 3.2vw, 34px); letter-spacing: -.01em; }
.phead p { margin: 2px 0 0; color: var(--label2); font-size: 15px; } .phead .sp { flex: 1; }
.tabbar { display: none; }
.no-side .layout { grid-template-columns: minmax(0, 1fr); } .no-side .side { display: none; }
@media (max-width: 1100px) and (min-width: 760px) {
  .layout { grid-template-columns: 90px minmax(0, 1fr); }
  .side { padding: 16px 8px; align-items: center; } .side .logo { padding: 2px 0 14px; } .side .logo b { display: none; }
  .side .nav a { flex-direction: column; gap: 4px; padding: 7px 2px; font-size: 11.5px; text-align: center; width: 74px; line-height: 1.2; } .side .nav a.on { background: none; }
  .side .nav .live { left: 48px; }
  .plan-card { width: 64px; height: 64px; min-height: 0; padding: 0; border-radius: 20px; } .plan-card b, .plan-card small { display: none; } .plan-card .mascot { right: 6px; bottom: -2px; }
  .me-row { justify-content: center; padding: 12px 0 0; } .me-row span { display: none; }
  .page { padding: 6px 24px 64px; }
}
@media (max-width: 759px) {
  .layout { grid-template-columns: minmax(0, 1fr); } .side { display: none; }
  .topbar { padding: env(safe-area-inset-top) 14px 0; min-height: 56px; } .topbar .mlogo { display: flex; }
  .topbar.sub .mlogo { display: none; }
  .page { padding: 2px 16px calc(108px + env(safe-area-inset-bottom)); }
  .phead { margin: 2px 0 16px; } .phead h1 { font-size: 26px; }
  .tabbar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 35; display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px 6px; background: color-mix(in srgb, var(--bg2) 90%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-radius: 24px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--sep); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--label3); font-size: 11px; font-weight: 600; padding: 5px 0; border-radius: 17px; position: relative; }
  .tabbar a svg { width: 24px; height: 24px; } .tabbar a.on { color: var(--brand); background: var(--brand-soft); }
  .tabbar a .live { position: absolute; top: 3px; left: calc(50% + 7px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg2); }
  .no-tab .tabbar { display: none; } .no-tab .page { padding-bottom: 60px; }
}

/* ── การ์ด กลุ่ม รายการ ── */
.card { background: var(--bg2); border-radius: var(--r); box-shadow: var(--shadow); }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font: 500 18px var(--display); color: var(--label); margin: 28px 2px 12px; }
.sec-h span, .sec-h a { font: 500 14px var(--font); color: var(--label2); } .sec-h a { color: var(--brand); }
.col-l > .sec-h:first-child, .col-r > .sec-h:first-child { margin-top: 4px; }
.group { background: var(--bg2); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 13px; min-height: 56px; padding: 10px 16px; position: relative; color: var(--label); width: 100%; background: none; border: 0; text-align: left; cursor: pointer; transition: background .12s; }
.row + .row::before { content: ''; position: absolute; top: 0; left: 64px; right: 16px; height: 1px; background: var(--sep); }
.row.noicon + .row::before, .group.noicon .row + .row::before { left: 16px; }
a.row:hover, button.row:hover { background: var(--fill); }
.row .ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.row .ic svg { width: 20px; height: 20px; }
.row .main { flex: 1; min-width: 0; } .row .main b { display: block; font-weight: 500; } .row .main small { display: block; color: var(--label2); font-size: 13.5px; line-height: 1.35; margin-top: 1px; }
.row .val { color: var(--label2); font-variant-numeric: tabular-nums; font-size: 15px; }
.row .chev { color: var(--label3); width: 16px; height: 16px; }
.row.danger { color: var(--red); justify-content: center; font-weight: 600; }
.foot { font-size: 13.5px; color: var(--label2); margin: 8px 4px 0; }
.c-blue { background: var(--blue); } .c-green { background: var(--green); } .c-red { background: var(--red); } .c-orange { background: var(--orange); } .c-purple { background: var(--purple); } .c-indigo { background: var(--indigo); } .c-teal { background: var(--teal); } .c-pink { background: var(--pink); } .c-gray { background: #8C90AE; } .c-yellow { background: var(--yellow); }

/* ── ปุ่ม ช่องกรอก สวิตช์ แบ่งส่วน ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 16px; border: 0; background: var(--brand); color: #fff; font: 600 16.5px var(--font); cursor: pointer; box-shadow: 0 10px 22px -12px var(--brand); transition: transform .15s, filter .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); } .btn:active { transform: scale(.97); } .btn[disabled] { opacity: .45; pointer-events: none; }
.btn.tint { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.btn.gray { background: var(--fill); color: var(--label); box-shadow: none; }
.btn.white { background: var(--bg2); color: var(--label); box-shadow: var(--shadow); }
.btn.plain { background: none; color: var(--brand); min-height: 44px; padding: 0 8px; box-shadow: none; }
.btn.sm { min-height: 38px; padding: 0 15px; font-size: 14.5px; border-radius: 12px; }
.btn.lg { min-height: 58px; padding: 0 30px; font-size: 18px; border-radius: 18px; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; }
.input { width: 100%; min-height: 50px; padding: 0 16px; border-radius: 14px; border: 0; background: var(--bg2); color: var(--label); font: inherit; }
.group .input { border-radius: 0; background: transparent; }
textarea.input { min-height: 150px; padding: 14px 16px; resize: vertical; }
.input:focus { outline: none; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 55%, transparent); }
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--fill2); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .22s cubic-bezier(.2, .9, .3, 1.3); }
.switch:checked { background: var(--green); } .switch:checked::after { transform: translateX(20px); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 13px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 10px; min-height: 36px; font-size: 14.5px; font-weight: 500; cursor: pointer; color: var(--label2); padding: 0 8px; white-space: nowrap; }
.seg button.on { background: var(--bg2); color: var(--label); font-weight: 600; box-shadow: var(--shadow); }
:root[data-theme="dark"] .seg button.on { background: var(--bg3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: var(--bg3); } }
.err { color: var(--red); font-size: 15px; min-height: 20px; margin: 8px 4px; }
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 99; background: var(--label); color: var(--bg); padding: 12px 20px; border-radius: 16px; font-size: 15px; font-weight: 500; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); animation: drop .35s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -14px) scale(.95); } }
.sheet { position: fixed; inset: 0; z-index: 70; background: rgba(15, 16, 40, .4); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet-in { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--bg); border-radius: 26px 26px 0 0; padding: 10px 18px calc(24px + env(safe-area-inset-bottom)); animation: rise .35s cubic-bezier(.2, .9, .25, 1); }
.sheet-in .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--fill2); margin: 0 auto 12px; }
.sheet-in h3 { font-size: 21px; text-align: center; margin: 6px 0 14px; }
@media (min-width: 760px) { .sheet { align-items: center; } .sheet-in { border-radius: 26px; padding-bottom: 26px; } .sheet-in .grab { display: none; } }
@keyframes rise { from { transform: translateY(30%); opacity: .3; } } @keyframes fade { from { opacity: 0; } }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--fill2); border-top-color: var(--brand); animation: rot .9s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--label2); padding: 40px 16px; gap: 10px; }
.empty b { color: var(--label); font: 500 18px var(--display); } .empty p { margin: 0; max-width: 360px; }
.loading { display: grid; place-items: center; gap: 8px; padding: 80px 0; color: var(--label2); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } html { scroll-behavior: auto; } }

/* ── หน้าแนะนำ (ยังไม่ล็อกอิน) ── */
.lp { overflow-x: clip; --gut: clamp(18px, 5vw, 48px); }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }
.lp-nav { position: fixed; inset: 0 0 auto; z-index: 40; transition: background .35s, box-shadow .35s, backdrop-filter .35s; }
.lp-nav.solid { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); box-shadow: 0 1px 0 var(--sep); }
.lp-nav .in { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 22px var(--display); color: var(--label); } .brand img { width: 38px; height: 38px; border-radius: 12px; transition: transform .5s cubic-bezier(.2, .9, .3, 1.4); } .brand:hover img { transform: rotate(-10deg) scale(1.06); }
.lp-nav .links { display: flex; gap: 2px; margin-left: 8px; } .lp-nav .links a { position: relative; color: var(--label2); font-weight: 500; padding: 8px 14px; border-radius: 12px; transition: color .2s; }
.lp-nav .links a::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.2, .9, .3, 1); }
.lp-nav .links a:hover { color: var(--label); } .lp-nav .links a:hover::after { transform: scaleX(1); }
.lp-nav .sp { flex: 1; }
@media (max-width: 880px) { .lp-nav .links, .lp-nav .login { display: none; } }

/* ส่วนหัว: พื้นไล่สีเคลื่อนไหว */
.hero-bg { position: relative; isolation: isolate; padding-top: 68px; }
.mesh { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.mesh i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.mesh i:nth-child(1) { width: 46vw; height: 46vw; max-width: 620px; max-height: 620px; left: -12vw; top: -8vw; background: #A9B8FF; }
.mesh i:nth-child(2) { width: 38vw; height: 38vw; max-width: 520px; max-height: 520px; right: -8vw; top: 4vw; background: #D9C2FF; animation-duration: 22s; animation-delay: -6s; }
.mesh i:nth-child(3) { width: 30vw; height: 30vw; max-width: 420px; max-height: 420px; left: 34%; bottom: -10vw; background: #B6ECFF; animation-duration: 26s; animation-delay: -12s; }
:root[data-theme="dark"] .mesh i { opacity: .22; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mesh i { opacity: .22; } }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vw, 4vw) scale(1.12); } 100% { transform: translate(-4vw, 6vw) scale(.94); } }
.mesh::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--label) 10%, transparent) 1px, transparent 1px); background-size: 26px 26px; mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%); }
.hero { display: grid; gap: 48px; align-items: center; padding-top: clamp(36px, 7vw, 84px); padding-bottom: clamp(40px, 6vw, 72px); }
@media (min-width: 1000px) { .hero { grid-template-columns: 1fr 1.05fr; gap: 64px; } }
.hero .tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: color-mix(in srgb, var(--bg2) 80%, transparent); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; color: var(--label2); backdrop-filter: blur(8px); }
.hero .tag b { background: linear-gradient(110deg, var(--brand), var(--purple)); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; }
.hero h1 { font-size: clamp(40px, 6.2vw, 72px); font-weight: 600; letter-spacing: -.025em; line-height: 1.08; margin-top: 20px; }
.hero h1 .w { display: inline-block; opacity: 0; transform: translateY(.45em); filter: blur(8px); animation: wordIn .8s cubic-bezier(.2, .9, .3, 1) forwards; animation-delay: calc(var(--i) * 90ms + 150ms); }
@keyframes wordIn { to { opacity: 1; transform: none; filter: none; } }
.hero h1 em { font-style: normal; background: linear-gradient(110deg, var(--brand), var(--purple), var(--pink), var(--brand)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: wordIn .8s cubic-bezier(.2, .9, .3, 1) forwards, shine 6s linear infinite; }
@keyframes shine { to { background-position: 300% 0; } }
.fade-up { opacity: 0; transform: translateY(18px); animation: fadeUp .8s cubic-bezier(.2, .9, .3, 1) forwards; animation-delay: var(--d, 0ms); }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
.hero p.lead { font-size: clamp(17px, 1.6vw, 19.5px); color: var(--label2); margin: 20px 0 30px; max-width: 32em; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn.glow { position: relative; overflow: hidden; }
.btn.glow::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-120%); animation: sweep 3.6s ease-in-out infinite 1.6s; }
@keyframes sweep { 60%, 100% { transform: translateX(120%); } }
.hero .devices { display: flex; gap: 20px; margin-top: 28px; color: var(--label2); font-size: 14.5px; font-weight: 500; flex-wrap: wrap; } .hero .devices span { display: flex; align-items: center; gap: 6px; } .hero .devices svg { width: 18px; height: 18px; color: var(--brand); }

/* จอไอแพดจำลอง + ปากกาเขียนเอง */
.hero-art { position: relative; perspective: 1400px; opacity: 0; animation: artIn 1.1s cubic-bezier(.2, .9, .3, 1) .35s forwards; }
@keyframes artIn { from { opacity: 0; transform: translateY(40px) rotateX(10deg); } to { opacity: 1; transform: none; } }
.tablet { position: relative; padding: 14px; border-radius: 38px; background: linear-gradient(160deg, #2C3055, #14162A); box-shadow: 0 50px 90px -40px rgba(30, 30, 90, .6), inset 0 0 0 2px rgba(255, 255, 255, .07); transform: rotateY(-8deg) rotateX(4deg); transition: transform .6s cubic-bezier(.2, .9, .3, 1); }
.hero-art:hover .tablet { transform: rotateY(-2deg) rotateX(1deg); }
@media (max-width: 999px) { .tablet { transform: none; } }
.tablet .screen { position: relative; border-radius: 26px; overflow: hidden; background: var(--bg); }
.demo { position: relative; padding: 22px; }
.demo .ink-layer { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; z-index: 4; }
.demo .hint { position: absolute; right: 16px; top: 14px; z-index: 5; font-size: 13px; color: var(--brand); background: var(--brand-soft); padding: 5px 11px; border-radius: 999px; display: flex; align-items: center; gap: 5px; pointer-events: none; font-weight: 600; transition: opacity .3s; } .demo .hint svg { width: 15px; height: 15px; }
.auto-ink { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; transition: opacity .4s; }
.auto-ink path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: ink 7s ease-in-out infinite; animation-delay: var(--d); }
@keyframes ink { 0% { stroke-dashoffset: var(--len); opacity: 1; } 18%, 82% { stroke-dashoffset: 0; opacity: 1; } 92%, 100% { stroke-dashoffset: 0; opacity: 0; } }
.auto-ink .nib { animation: nib 7s ease-in-out infinite; transform-box: fill-box; }
.demo.mine .auto-ink, .demo.mine .hint { opacity: 0; }
.hero-art .mascot { position: absolute; z-index: 6; left: -36px; bottom: -42px; filter: drop-shadow(0 18px 26px rgba(60, 70, 200, .3)); }
.float-chip { position: absolute; z-index: 6; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 16px; background: color-mix(in srgb, var(--bg2) 92%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; }
.float-chip .d { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: #fff; } .float-chip .d svg { width: 16px; height: 16px; }
.float-chip.a { right: -18px; top: 40px; animation: bob 4s ease-in-out infinite; } .float-chip.b { right: 30px; bottom: -24px; animation: bob 4.8s ease-in-out infinite reverse; }
@media (max-width: 600px) { .float-chip, .hero-art .mascot { display: none; } .tablet { padding: 8px; border-radius: 26px; } .tablet .screen { border-radius: 19px; } .demo { padding: 16px; } .demo .big { font-size: 22px; } }

/* แถบวิชาเลื่อนวน */
.marquee { position: relative; overflow: hidden; padding: 18px 0; border-top: 1px solid var(--sep); border-bottom: 1px solid var(--sep); background: color-mix(in srgb, var(--bg2) 60%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee .track { display: flex; gap: 14px; width: max-content; animation: marq 38s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
.marquee span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--bg2); box-shadow: var(--shadow); font-weight: 600; font-size: 14.5px; white-space: nowrap; color: var(--label); }
.marquee span i { width: 10px; height: 10px; border-radius: 50%; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ส่วนเนื้อหา */
.lp-sec { padding-top: clamp(72px, 9vw, 120px); }
.lp-sec .kicker { display: inline-block; color: var(--brand); font-weight: 700; font-size: 13.5px; letter-spacing: .06em; background: var(--brand-soft); padding: 4px 12px; border-radius: 999px; }
.lp-sec h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 600; letter-spacing: -.02em; margin: 12px 0 12px; line-height: 1.15; }
.lp-sec .sub { color: var(--label2); font-size: clamp(16.5px, 1.5vw, 18px); max-width: 38em; margin: 0; }
.lp-sec .center { text-align: center; } .lp-sec .center .sub { margin: 0 auto; }
.rv { opacity: 0; transform: translateY(34px) scale(.98); transition: opacity .9s cubic-bezier(.2, .9, .3, 1), transform .9s cubic-bezier(.2, .9, .3, 1); transition-delay: var(--d, 0ms); }
.rv.in { opacity: 1; transform: none; }
.subjects { display: grid; gap: 18px; margin-top: 40px; } @media (min-width: 640px) { .subjects { grid-template-columns: 1fr 1fr; } } @media (min-width: 1060px) { .subjects { grid-template-columns: repeat(4, 1fr); } }
.subj { position: relative; overflow: hidden; padding: 24px; border-radius: 28px; background: var(--bg2); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; transform-style: preserve-3d; transition: box-shadow .3s, transform .2s ease-out; will-change: transform; }
.subj:hover { box-shadow: var(--shadow-lg); }
.subj h3 { font-size: 20px; margin-top: 10px; } .subj p { margin: 0; color: var(--label2); font-size: 14.5px; }
.subj ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; } .subj li { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--fill); color: var(--label2); }
.subj .bg { position: absolute; right: -34px; top: -34px; width: 130px; height: 130px; border-radius: 42px; opacity: .14; transform: rotate(18deg); transition: transform .6s cubic-bezier(.2, .9, .3, 1); } .subj:hover .bg { transform: rotate(40deg) scale(1.15); }
.subj .appicon { transition: transform .5s cubic-bezier(.2, .9, .3, 1.5); } .subj:hover .appicon { transform: translateY(-4px) rotate(-6deg); }
.feat-row { display: grid; gap: 40px; align-items: center; margin-top: clamp(56px, 7vw, 96px); }
@media (min-width: 960px) { .feat-row { grid-template-columns: 1fr 1fr; gap: 72px; } .feat-row.rev .fr-text { order: 2; } }
.fr-text .appicon { margin-bottom: 18px; }
.fr-text h3 { font-size: clamp(25px, 2.8vw, 34px); font-weight: 600; letter-spacing: -.01em; } .fr-text p { color: var(--label2); font-size: 17.5px; margin: 12px 0 0; }
.fr-text ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; } .fr-text li { display: flex; gap: 10px; align-items: flex-start; } .fr-text li svg { color: var(--green); width: 22px; height: 22px; margin-top: 1px; flex: none; }
.mock { position: relative; padding: 24px; border-radius: 32px; background: var(--bg2); box-shadow: var(--shadow-lg); transition: transform .5s cubic-bezier(.2, .9, .3, 1); }
.mock:hover { transform: translateY(-6px); }
.mock.tint { background: linear-gradient(160deg, var(--brand-soft), var(--bg2) 70%); }
.mock .steps li { opacity: 0; transform: translateX(-14px); transition: opacity .5s, transform .5s cubic-bezier(.2, .9, .3, 1); animation: none; }
.mock.in .steps li { opacity: 1; transform: none; } .mock.in .steps li:nth-child(2) { transition-delay: .45s; } .mock.in .steps li:nth-child(3) { transition-delay: .9s; }
.mock .verdict { transform: scale(.9); opacity: 0; transition: all .5s cubic-bezier(.2, .9, .3, 1.4) .1s; } .mock.in .verdict { transform: none; opacity: 1; }
.mock .ring-fill { transition: stroke-dasharray 2.2s cubic-bezier(.2, .9, .3, 1); }
.mock .week .d i { transform: scaleY(0); transform-origin: bottom; transition: transform .9s cubic-bezier(.2, .9, .3, 1.2); transition-delay: calc(var(--i) * 80ms + .3s); } .mock.in .week .d i { transform: none; }
.mock .ai-box .caret { display: inline-block; width: 2px; height: 1.1em; background: var(--purple); vertical-align: -3px; margin-left: 1px; animation: caret .9s steps(1) infinite; } @keyframes caret { 50% { opacity: 0; } }
.write-svg path { fill: none; stroke-linecap: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 1.6s cubic-bezier(.4, 0, .2, 1); transition-delay: var(--d, 0s); }
.mock.in .write-svg path { stroke-dashoffset: 0; }
.write-svg .hand { opacity: 0; transition: opacity .6s 1.4s; } .mock.in .write-svg .hand { opacity: 1; }

/* ราคา · คำถาม · ปิดท้าย */
.price { display: grid; gap: 20px; margin: 40px auto 0; max-width: 920px; } @media (min-width: 760px) { .price { grid-template-columns: 1fr 1fr; } }
.pcard { position: relative; padding: 28px; border-radius: 30px; background: var(--bg2); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; transition: transform .4s cubic-bezier(.2, .9, .3, 1.3), box-shadow .3s; }
.pcard:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.pcard.hot { background: linear-gradient(160deg, #5B7BFF, #8B5CF6 60%, #B44CE0); background-size: 200% 200%; animation: hue 10s ease-in-out infinite alternate; color: #fff; box-shadow: 0 30px 60px -24px #6B5CF6; }
@keyframes hue { to { background-position: 100% 100%; } }
.pcard .nm { font: 500 20px var(--display); } .pcard .pp { font: 700 44px var(--font); line-height: 1.1; } .pcard .pp small { font: 500 16px var(--font); opacity: .75; }
.pcard ul { list-style: none; padding: 0; margin: 10px 0 20px; display: grid; gap: 10px; flex: 1; } .pcard li { display: flex; gap: 10px; } .pcard li svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--green); } .pcard.hot li svg { color: #fff; }
.pcard .btn { margin-top: auto; } .pcard.hot .btn { background: #fff; color: #4A4FE6; box-shadow: none; }
.pcard .mascot { position: absolute; right: 18px; top: -46px; }
.faq { max-width: 820px; margin: 36px auto 0; display: grid; gap: 12px; }
.qa { background: var(--bg2); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .3s; }
.qa.open { box-shadow: var(--shadow-lg); }
.qa button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 22px; border: 0; background: none; cursor: pointer; text-align: left; font-weight: 600; font-size: 17px; color: var(--label); }
.qa button .pm { position: relative; width: 28px; height: 28px; border-radius: 9px; background: var(--brand-soft); flex: none; transition: transform .35s cubic-bezier(.2, .9, .3, 1.4), background .3s; }
.qa button .pm::before, .qa button .pm::after { content: ''; position: absolute; left: 8px; right: 8px; top: 13px; height: 2px; border-radius: 2px; background: var(--brand); transition: transform .35s; } .qa button .pm::after { transform: rotate(90deg); }
.qa.open button .pm { transform: rotate(180deg); background: var(--brand); } .qa.open button .pm::before, .qa.open button .pm::after { background: #fff; } .qa.open button .pm::after { transform: rotate(0); }
.qa .ans { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s cubic-bezier(.2, .9, .3, 1); } .qa.open .ans { grid-template-rows: 1fr; }
.qa .ans > div { overflow: hidden; } .qa .ans p { margin: 0; padding: 0 22px 22px; color: var(--label2); }
.cta-band { position: relative; overflow: hidden; margin-top: clamp(72px, 9vw, 120px); padding: clamp(32px, 5vw, 56px); border-radius: 36px; color: #fff; background: linear-gradient(120deg, #4A6CF7, #6B5CF6, #9B5CF6, #4A6CF7); background-size: 300% 300%; animation: hue 12s ease-in-out infinite alternate; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; box-shadow: 0 30px 70px -30px #4A5CF7; }
.cta-band::before { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; right: -120px; top: -160px; background: rgba(255, 255, 255, .1); }
.cta-band h2 { color: #fff; font-size: clamp(26px, 3.4vw, 40px); font-weight: 600; } .cta-band p { margin: 8px 0 0; opacity: .9; font-size: 17px; }
.cta-band .txt { flex: 1; min-width: 240px; position: relative; } .cta-band .btn { background: #fff; color: #4A4FE6; box-shadow: none; position: relative; }
.lp-foot { display: flex; gap: 14px 24px; flex-wrap: wrap; align-items: center; color: var(--label2); font-size: 14.5px; padding-top: 44px; padding-bottom: 52px; } .lp-foot .sp { flex: 1; } .lp-foot a { color: var(--label2); } .lp-foot a:hover { color: var(--label); }
@media (prefers-reduced-motion: reduce) { .hero h1 .w, .fade-up, .hero-art, .rv, .mock .steps li, .mock .verdict { opacity: 1 !important; transform: none !important; filter: none !important; } .auto-ink { display: none; } .marquee .track { animation: none; } }
.hw { animation: hw 7s ease-in-out infinite; animation-delay: var(--d); font: 500 22px var(--display); }
@keyframes hw { 0% { clip-path: inset(0 100% 0 0); opacity: 1; } 22%, 82% { clip-path: inset(0 0 0 0); opacity: 1; } 92%, 100% { clip-path: inset(0 0 0 0); opacity: 0; } }
.appicon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .1), 0 8px 16px -10px rgba(40, 40, 120, .5); }
.appicon svg { width: 26px; height: 26px; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth { width: 100%; max-width: 440px; background: var(--bg2); border-radius: 30px; padding: 26px 22px 24px; box-shadow: var(--shadow-lg); text-align: center; }
.auth h1 { font-size: 28px; margin: 8px 0 4px; } .auth form { text-align: left; } .auth .group { box-shadow: none; background: var(--bg3); }

/* ── หน้าวันนี้ ── */
.home { display: grid; gap: 22px; }
@media (min-width: 1180px) { .home { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .home .col-r { position: sticky; top: 76px; } }
.col-l, .col-r { display: grid; gap: 18px; min-width: 0; align-content: start; }
.hello { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 24px 22px 24px 26px; border-radius: 28px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #8B5CF6 0%, transparent 55%), linear-gradient(135deg, #4A6CF7, #5B5FEF); box-shadow: 0 22px 44px -22px #4A5CF7; }
.hello .txt { flex: 1; min-width: 0; position: relative; z-index: 1; }
.hello small { font-size: 14px; opacity: .85; } .hello h2 { font-size: clamp(22px, 2.6vw, 28px); margin: 2px 0 8px; color: #fff; }
.hello .bubble { display: inline-block; background: rgba(255, 255, 255, .18); border-radius: 14px 14px 14px 4px; padding: 8px 13px; font-size: 14.5px; }
.hello .btns { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hello .btn { background: #fff; color: #3F55E6; box-shadow: none; min-height: 44px; } .hello .btn.ghost { background: rgba(255, 255, 255, .16); color: #fff; }
.hello::after { content: ''; position: absolute; right: -60px; bottom: -90px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hello .mascot { position: relative; z-index: 1; }
@media (max-width: 520px) { .hello { padding: 18px; gap: 10px; } .hello .mascot { width: 84px; height: 88px; } }
.chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px 2px 8px; }
.chips::-webkit-scrollbar { display: none; }
.cd { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 18px; background: var(--bg2); color: var(--label); box-shadow: var(--shadow); border: 0; font: inherit; text-align: left; }
.cd .n { min-width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; text-align: center; color: #fff; line-height: 1; font: 600 21px var(--display); padding: 0 6px; }
.cd .n small { display: block; font: 500 11px var(--font); opacity: .9; margin-top: 2px; }
.cd b { display: block; font-size: 15px; font-weight: 600; } .cd span span { font-size: 13px; color: var(--label2); }
.cd.add { color: var(--brand); background: var(--brand-soft); box-shadow: none; font-weight: 600; font-size: 15px; padding: 0 18px; cursor: pointer; gap: 6px; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--bg2); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.stat .top { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--label2); font-size: 13.5px; font-weight: 500; }
.stat b { font: 500 28px var(--display); font-variant-numeric: tabular-nums; line-height: 1.05; } .stat b small { font: 500 14px var(--font); color: var(--label2); }
.stat .pbar { height: 7px; border-radius: 9px; background: var(--fill); overflow: hidden; } .stat .pbar i { display: block; height: 100%; border-radius: 9px; transition: width .7s cubic-bezier(.2, .9, .3, 1); }
.stat .dot { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; } .stat .dot svg { width: 17px; height: 17px; }
@media (max-width: 520px) { .stats3 { gap: 8px; } .stat { padding: 12px; border-radius: 18px; } .stat b { font-size: 22px; } .stat .top span { font-size: 12px; } .stat .dot { width: 24px; height: 24px; border-radius: 8px; } }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; min-height: 156px; border-radius: 24px; background: var(--bg2); color: var(--label); overflow: hidden; box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.2, .9, .3, 1.3), box-shadow .2s; }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tile .appicon { margin-bottom: auto; width: 54px; height: 54px; border-radius: 17px; } .tile .appicon svg { width: 28px; height: 28px; }
.tile b { font: 500 17.5px var(--display); margin-top: 14px; } .tile span { font-size: 13.5px; color: var(--label2); line-height: 1.35; }
.tile .badge { position: absolute; top: 14px; right: 14px; font-size: 12px; font-weight: 700; color: #fff; background: var(--red); border-radius: 999px; padding: 2px 9px; min-width: 24px; text-align: center; }
.g-blue { background: linear-gradient(150deg, #7D9BFF, #4A6CF7); } .g-orange { background: linear-gradient(150deg, #FFC26B, #FF8A2B); } .g-green { background: linear-gradient(150deg, #5BE3A4, #17B26A); } .g-purple { background: linear-gradient(150deg, #B693FF, #7C4DF2); }
.g-red { background: linear-gradient(150deg, #FF8A8F, #EE4249); } .g-indigo { background: linear-gradient(150deg, #9A9CFF, #5457EA); } .g-teal { background: linear-gradient(150deg, #66DCEC, #14A6C0); } .g-pink { background: linear-gradient(150deg, #FF9EC4, #F45793); } .g-gray { background: linear-gradient(150deg, #B4B7CF, #7E82A1); } .g-yellow { background: linear-gradient(150deg, #FFDB6B, #F5AE14); }
.subj-cards { display: grid; gap: 12px; } @media (min-width: 640px) { .subj-cards { grid-template-columns: 1fr 1fr; } }
.sc { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 22px; background: var(--bg2); color: var(--label); box-shadow: var(--shadow); transition: transform .2s; }
.sc:hover { transform: translateY(-2px); }
.sc .main { flex: 1; min-width: 0; } .sc b { display: block; font: 500 16px var(--display); } .sc small { color: var(--label2); font-size: 13px; }
.sc .pbar { height: 6px; border-radius: 9px; background: var(--fill); margin-top: 8px; overflow: hidden; } .sc .pbar i { display: block; height: 100%; border-radius: 9px; }
.sc .pc { font: 500 17px var(--display); font-variant-numeric: tabular-nums; color: var(--label2); }
.rank .row .no { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--label2); background: var(--fill); font-variant-numeric: tabular-nums; flex: none; }
.rank .row .no.t1 { background: #FFE7A8; color: #9A6B00; } .rank .row .no.t2 { background: #E4E7F2; color: #5B6384; } .rank .row .no.t3 { background: #FFD9C2; color: #A0522D; }
.rank .row.me { background: var(--brand-soft); }
.side-card { padding: 18px; } .side-card h3 { font-size: 17px; }
.vmini { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.vmini .big { font: 500 36px var(--display); line-height: 1; } .vmini .big small { font: 500 14px var(--font); color: var(--label2); }

/* ── ทำข้อสอบ ── */
.prog { height: 8px; border-radius: 9px; background: var(--fill); overflow: hidden; flex: 1; } .prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--purple)); border-radius: 9px; transition: width .4s cubic-bezier(.2, .9, .3, 1); }
.timer { font-variant-numeric: tabular-nums; color: var(--label2); font-size: 15px; min-width: 46px; text-align: right; font-weight: 500; }
.pr { display: grid; gap: 16px; }
@media (min-width: 1000px), (min-width: 760px) and (orientation: landscape) { .pr { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); align-items: stretch; } }
.qcard { background: var(--bg2); border-radius: 28px; padding: 24px; box-shadow: var(--shadow); }
.q-meta { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--label2); margin-bottom: 10px; font-weight: 500; }
.q-meta .sp { flex: 1; }
.diff { display: inline-flex; gap: 3px; } .diff i { width: 7px; height: 7px; border-radius: 50%; background: var(--fill2); } .diff i.on { background: var(--orange); }
.stem { font-size: 18px; line-height: 1.6; white-space: pre-wrap; }
.big { font: 600 28px/1.4 ui-monospace, 'SF Mono', Menlo, monospace; text-align: center; padding: 18px 6px; word-spacing: .12em; color: var(--label); }
.figwrap { display: flex; justify-content: center; margin: 14px 0 4px; }
.fig { max-width: 100%; height: auto; }
.fig.iso { width: min(320px, 100%); } .fig.net { width: min(270px, 100%); } .fig.view { width: 100%; max-width: 110px; max-height: 100px; } .fig.top { width: 100%; max-width: 120px; }
.fig .ft { fill: #FFE6A3; stroke: #23264A; stroke-width: 1.1; } .fig .fr { fill: #8DA6FF; stroke: #23264A; stroke-width: 1.1; } .fig .fl { fill: #C6D2FF; stroke: #23264A; stroke-width: 1.1; }
.fig .lb, .fig .lb2 { font: 600 13px var(--font); fill: var(--label2); }
.fig .vc { fill: #C6D2FF; stroke: #23264A; stroke-width: 1.1; } .fig .gl { stroke: var(--label2); stroke-width: 1.5; }
.fig .tc { fill: #FFE6A3; stroke: #23264A; stroke-width: 1; } .fig .te { fill: none; stroke: var(--label3); stroke-width: 1; stroke-dasharray: 3 3; } .fig .tn { font: 700 13px var(--font); fill: #23264A; }
.fig .nc { fill: #FFF4D6; stroke: #23264A; stroke-width: 1.3; } .fig .nl { font: 700 20px var(--font); fill: #23264A; }
.choices { margin-top: 18px; display: grid; gap: 10px; }
.choices.svgs { grid-template-columns: 1fr 1fr; }
.ch { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 12px 14px; min-height: 56px; border: 2px solid var(--sep); border-radius: 18px; background: var(--bg2); cursor: pointer; position: relative; transition: border-color .15s, background .15s, transform .15s; color: var(--label); }
.ch:hover { border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: color-mix(in srgb, var(--brand) 4%, var(--bg2)); }
.ch:active { transform: scale(.985); }
.ch .k { flex: none; width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; background: var(--fill); font-weight: 700; font-size: 14.5px; color: var(--label2); transition: all .2s; }
.ch .v { flex: 1; min-width: 0; font-size: 17px; }
.choices.svgs .ch { flex-direction: column; align-items: stretch; } .choices.svgs .ch .v { display: flex; justify-content: center; }
.ch.right { border-color: var(--green); background: color-mix(in srgb, var(--green) 9%, var(--bg2)); } .ch.right .k { background: var(--green); color: #fff; }
.ch.wrong { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--bg2)); } .ch.wrong .k { background: var(--red); color: #fff; }
.ch.locked { cursor: default; } .ch.locked:hover { transform: none; }
.ch.right .k, .ch.wrong .k { animation: kpop .4s cubic-bezier(.2, .9, .3, 1.5); } @keyframes kpop { 50% { transform: scale(1.22); } }
.verdict { display: flex; align-items: center; gap: 12px; margin: 20px 0 6px; padding: 10px 16px 10px 10px; border-radius: 20px; }
.verdict .t { flex: 1; } .verdict b { display: block; font: 500 19px var(--display); } .verdict small { color: var(--label2); font-size: 13.5px; }
.verdict.ok { background: color-mix(in srgb, var(--green) 10%, transparent); } .verdict.ok b { color: var(--green); }
.verdict.no { background: color-mix(in srgb, var(--red) 9%, transparent); } .verdict.no b { color: var(--red); }
.steps { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: s; display: grid; gap: 8px; }
.steps li { counter-increment: s; position: relative; padding: 12px 14px 12px 52px; background: var(--bg3); border-radius: 16px; animation: stepIn .45s cubic-bezier(.2, .9, .3, 1) both; }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 11px; width: 26px; height: 26px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } }
.after { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.after .btn:first-child { flex: 1 1 160px; }
.ai-box { margin-top: 12px; padding: 16px; border-radius: 18px; background: color-mix(in srgb, var(--purple) 9%, var(--bg2)); white-space: pre-wrap; font-size: 16px; }
.ai-box b.h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--purple); font: 500 16px var(--display); } .ai-box b.h svg { width: 18px; height: 18px; }
.scratch { border-radius: 28px; min-height: 54vh; background-color: var(--paper); background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 26px 26px; display: grid; place-content: center; text-align: center; color: var(--label3); font-size: 15px; gap: 8px; box-shadow: var(--shadow); }
.scratch svg { width: 30px; height: 30px; margin: 0 auto; }
html.inking .scratch .hintx { opacity: 0; }
.result { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 20px; }
.result .score { font: 500 56px var(--display); line-height: 1; margin-top: 10px; } .result .score small { font-size: 22px; color: var(--label2); }
.result .r3 { display: flex; gap: 32px; margin-top: 18px; } .result .r3 b { display: block; font: 500 22px var(--display); } .result .r3 small { color: var(--label2); }

/* ── หมึกทั้งหน้าจอ ── */
#inkdoc { position: absolute; left: 0; top: 0; width: 100%; z-index: 50; pointer-events: none; }
#inkdoc canvas { display: block; width: 100%; height: 100%; }
html.inking #inkdoc { pointer-events: auto; cursor: crosshair; }
.ink-fab { position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; width: 58px; height: 58px; border-radius: 20px; border: 0; display: grid; place-items: center; background: linear-gradient(150deg, #7D9BFF, #4A6CF7); color: #fff; box-shadow: 0 14px 30px -10px #4A6CF7; cursor: pointer; transition: transform .2s cubic-bezier(.2, .9, .3, 1.4), border-radius .2s; }
.ink-fab svg { width: 26px; height: 26px; } .ink-fab:hover { transform: translateY(-2px) rotate(-6deg); } .ink-fab:active { transform: scale(.92); }
.ink-fab[hidden] { display: none; }
html.inking .ink-fab { background: var(--label); color: var(--bg); border-radius: 50%; }
@media (max-width: 759px) { .ink-fab { right: 16px; bottom: calc(94px + env(safe-area-inset-bottom)); width: 54px; height: 54px; } .no-tab .ink-fab { bottom: calc(22px + env(safe-area-inset-bottom)); } }
.ink-pal { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 61; display: flex; align-items: center; gap: 2px; padding: 7px; border-radius: 22px; background: color-mix(in srgb, var(--bg2) 94%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow-lg), 0 0 0 1px var(--sep); animation: palIn .3s cubic-bezier(.2, .9, .3, 1.2); max-width: calc(100% - 110px); overflow-x: auto; scrollbar-width: none; }
.ink-pal[hidden] { display: none; }
@keyframes palIn { from { opacity: 0; transform: translate(-50%, 16px) scale(.94); } }
.ink-pal .tb { width: 42px; height: 42px; flex: none; border-radius: 13px; border: 0; background: none; display: grid; place-items: center; color: var(--label2); cursor: pointer; }
.ink-pal .tb:hover { background: var(--fill); } .ink-pal .tb.on { background: var(--brand-soft); color: var(--brand); } .ink-pal .tb svg { width: 22px; height: 22px; }
.ink-pal .sw { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 0; margin: 0 3px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .15s; }
.ink-pal .sw.on { transform: scale(1.12); box-shadow: 0 0 0 2px var(--bg2), 0 0 0 4px var(--brand); }
.ink-pal .div { width: 1px; height: 24px; background: var(--sep); margin: 0 5px; flex: none; }
.ink-pal .done { border: 0; background: var(--brand); color: #fff; font-weight: 600; padding: 0 14px; height: 40px; border-radius: 13px; cursor: pointer; flex: none; margin-left: 4px; }
@media (max-width: 759px) { .ink-pal { left: 12px; transform: none; max-width: calc(100% - 92px); bottom: calc(94px + env(safe-area-inset-bottom)); animation: none; } .no-tab .ink-pal { bottom: calc(24px + env(safe-area-inset-bottom)); } }

/* ── จับเวลา ── */
.timer-wrap { display: grid; gap: 20px; } @media (min-width: 1000px) { .timer-wrap { grid-template-columns: 1.05fr 1fr; align-items: start; } }
.clock-card { padding: 26px 18px 28px; display: flex; flex-direction: column; align-items: center; }
.clock { position: relative; width: min(290px, 74vw); aspect-ratio: 1; }
.clock svg { width: 100%; height: 100%; transform: rotate(-90deg); } .clock circle { fill: none; stroke-width: 14; stroke-linecap: round; }
.clock .t { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.clock .t b { font: 300 clamp(48px, 13vw, 62px) var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1; }
.clock .t span { color: var(--label2); font-size: 14.5px; margin-top: 8px; }
.subj-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.subj-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 20px; border: 2px solid transparent; background: var(--bg2); cursor: pointer; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; color: var(--label); }
.subj-pick button:hover { transform: translateY(-2px); }
.subj-pick button .appicon { width: 44px; height: 44px; border-radius: 14px; } .subj-pick button .appicon svg { width: 24px; height: 24px; }
.subj-pick button small { color: var(--label2); font-variant-numeric: tabular-nums; font-size: 12px; }
.subj-pick button.on { border-color: var(--brand); } .subj-pick button[disabled] { opacity: .5; cursor: default; transform: none; } .subj-pick button.on[disabled] { opacity: 1; }
.ctrl { display: flex; justify-content: center; gap: 26px; margin-top: 24px; }
.ctrl button { width: 76px; height: 76px; border-radius: 26px; border: 0; display: grid; place-items: center; cursor: pointer; transition: transform .15s; }
.ctrl button:active { transform: scale(.94); } .ctrl button svg { width: 28px; height: 28px; }
.ctrl .go { background: linear-gradient(150deg, #5BE3A4, #17B26A); color: #fff; box-shadow: 0 14px 26px -12px #17B26A; }
.ctrl .pause { background: linear-gradient(150deg, #FFC26B, #FF8A2B); color: #fff; box-shadow: 0 14px 26px -12px #FF8A2B; }
.ctrl .stop { background: var(--fill); color: var(--label); }
.week { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 20px 18px 12px; }
.week .d { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.week .d i { width: 100%; max-width: 32px; border-radius: 9px 9px 4px 4px; background: color-mix(in srgb, var(--brand) 45%, transparent); min-height: 4px; } .week .d.td i { background: linear-gradient(180deg, var(--purple), var(--brand)); }
.week .d small { font-size: 12px; color: var(--label2); } .week .d em { font-style: normal; font-size: 11.5px; color: var(--label2); font-variant-numeric: tabular-nums; }

/* ── สมุดโน้ต ── */
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
.nbk { display: flex; flex-direction: column; gap: 8px; color: var(--label); text-align: center; border: 0; background: none; cursor: pointer; padding: 0; font: inherit; }
.nbk .cover { aspect-ratio: 3 / 4; border-radius: 8px 18px 18px 8px; background: var(--paper); box-shadow: var(--shadow), inset 9px 0 0 var(--cv, #4A6CF7); background-image: linear-gradient(var(--rule) 1px, transparent 1px); background-size: 100% 18px; display: grid; place-items: center; transition: transform .25s cubic-bezier(.2, .9, .3, 1.3); }
.nbk:hover .cover { transform: translateY(-4px) rotate(-1.5deg); }
.nbk .cover.new { background: var(--brand-soft); box-shadow: none; color: var(--brand); border: 2px dashed color-mix(in srgb, var(--brand) 40%, transparent); } .nbk .cover.new svg { width: 34px; height: 34px; }
.nbk b { font-size: 15px; font-weight: 600; } .nbk small { font-size: 12.5px; color: var(--label2); margin-top: -6px; }
.sheetpaper { position: relative; margin: 0 auto; width: 100%; max-width: 900px; aspect-ratio: 1 / 1.414; border-radius: 12px; background-color: var(--paper); box-shadow: var(--shadow-lg); overflow: hidden; }
.sheetpaper.grid { background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 4% 2.83%; }
.sheetpaper.lined { background-image: linear-gradient(transparent calc(100% - 1px), var(--rule) 1px); background-size: 100% 3.2%; }
.sheetpaper canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0; color: var(--label2); font-size: 15px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.note-title { border: 0; background: none; font: 500 26px var(--display); color: var(--label); width: 100%; padding: 4px 0; margin-bottom: 12px; }
.note-title:focus { outline: none; }
.note-pal { position: sticky; bottom: 16px; margin: 0 auto; width: max-content; max-width: 100%; z-index: 5; }
.note-pal .ink-pal { position: static; transform: none; animation: none; max-width: 100%; }
@media (max-width: 759px) { .note-pal { bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* ── ศัพท์ ── */
.flash-wrap { max-width: 620px; margin: 0 auto; }
.fcard { min-height: 330px; padding: 30px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; background: var(--bg2); border-radius: 30px; box-shadow: var(--shadow-lg); }
.fcard .w { font: 500 44px var(--display); letter-spacing: -.01em; } .fcard .ipa { color: var(--label2); font: 400 17px ui-monospace, Menlo, monospace; margin-top: 2px; }
.fcard .th { font: 500 24px var(--display); margin-top: 14px; } .fcard .pos { font-size: 14px; color: var(--label2); }
.fcard .ex { margin-top: 14px; color: var(--label); font-size: 16px; } .fcard .ex i { display: block; color: var(--label2); font-style: normal; font-size: 15px; }
.fcard .sy { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pill { font-size: 13px; padding: 4px 11px; border-radius: 999px; background: var(--fill); color: var(--label2); }
.fcard .tap { margin-top: 18px; font-size: 14px; color: var(--label3); }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.grades .btn { flex-direction: column; gap: 0; min-height: 64px; background: var(--bg2); color: var(--label); font-size: 16px; box-shadow: var(--shadow); } .grades small { font-weight: 400; font-size: 12px; color: var(--label2); }
.grades .g0 { color: var(--red); } .grades .g3 { color: var(--green); }
.write-pad { position: relative; height: 220px; margin-top: 14px; border-radius: 24px; background: var(--paper) repeating-linear-gradient(transparent 0 67px, var(--rule) 67px 68px); box-shadow: var(--shadow); }
.write-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.speak { width: 48px; height: 48px; border-radius: 16px; border: 0; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; cursor: pointer; }

/* ── บัญชี ── */
.prof { display: flex; align-items: center; gap: 16px; padding: 20px; }
.avatar { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; font: 500 30px var(--display); color: #fff; background: linear-gradient(135deg, #FFB86B, #FF6FA4); flex: none; }
.prof b { display: block; font: 500 21px var(--display); } .prof span { color: var(--label2); font-size: 14.5px; }
.plan-pill { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 11px; border-radius: 999px; background: var(--fill); color: var(--label2); }
.plan-pill.on { background: linear-gradient(110deg, var(--brand), var(--purple)); color: #fff; }
.settings { display: grid; gap: 4px 22px; } @media (min-width: 1000px) { .settings { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ── แอดมิน ── */
.adm td, .adm th { padding: 11px 14px; border-bottom: 1px solid var(--sep); text-align: left; font-size: 15px; } .adm table { width: 100%; border-collapse: collapse; } .adm th { color: var(--label2); font-weight: 500; font-size: 13px; }
.adm tr:last-child td { border-bottom: 0; } .adm .num { text-align: right; font-variant-numeric: tabular-nums; }
.rq { background: var(--bg2); border-radius: 20px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); } .rq ol { margin: 8px 0; padding-left: 22px; } .rq li.ans { font-weight: 700; color: var(--green); } .rq .note { font-size: 14px; color: var(--red); }
.katex { font-size: 1.05em; }

@media (min-width: 760px) { .topbar.bare { display: none; } .page { padding-top: 28px; } }

/* ตัวเลขใช้ Anuphan (Mitr วาดเลขศูนย์มีขีด) */
.stat b, .vmini .big, .cd .n, .clock .t b, .result .score, .result .r3 b, .sc .pc, .tile .badge, .rank .no, .week em { font-family: var(--font); font-weight: 700; }
.clock .t b { font-weight: 400; }
.side .logo b, .brand b, .topbar .mlogo b { font-weight: 600; }
.prof .avatar { font-size: 30px; color: #fff; }
.row.danger .main { text-align: center; }

/* ที่มาของโจทย์ */
.qsrc { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--fill); color: var(--label2); white-space: nowrap; }
.qsrc.real { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.hero h1 .w { white-space: nowrap; }
@media (min-width: 1000px) { .hero { grid-template-columns: 1.12fr 1fr; } .hero h1 { font-size: clamp(44px, 4.6vw, 66px); } }
.demo .hint { top: 14px; bottom: auto; right: 16px; }
.float-chip.a { top: 18px; bottom: auto; right: auto; left: -34px; }
