/* ==========================================================================
   Let Me Help — design system v3 "Logo tone"
   โทนสีตามโลโก้: น้ำเงิน (หลัก/ปุ่ม/พื้นเข้ม) · แดง (เน้น) · ส้ม (จุดเล็กๆ) บนพื้นขาวอมฟ้า
   กระจกเบลอ + แสงฟุ้งสีโลโก้ หัวข้อสองโทน ปุ่มเม็ดยา — ไม่มีอิโมจิ ไอคอนล้วน
   ========================================================================== */

@font-face { font-family: "Sarabun"; font-weight: 400; font-display: swap; src: url("../fonts/Sarabun-Regular.0ab9295c98c2.woff2") format("woff2"), url("../fonts/Sarabun-Regular.943f4762fbba.ttf") format("truetype"); }
@font-face { font-family: "Sarabun"; font-weight: 500; font-display: swap; src: url("../fonts/Sarabun-Medium.9a781ece2fb5.woff2") format("woff2"), url("../fonts/Sarabun-Medium.46095e37cda0.ttf") format("truetype"); }
@font-face { font-family: "Sarabun"; font-weight: 600; font-display: swap; src: url("../fonts/Sarabun-SemiBold.59f23b9b501b.woff2") format("woff2"), url("../fonts/Sarabun-SemiBold.3877ab44e38c.ttf") format("truetype"); }
@font-face { font-family: "Sarabun"; font-weight: 700; font-display: swap; src: url("../fonts/Sarabun-Bold.7805547307a1.woff2") format("woff2"), url("../fonts/Sarabun-Bold.69b0b84bbe65.ttf") format("truetype"); }

:root {
  --lmh-red: #d02023;
  --lmh-red-ink: #b01c1f;
  --lmh-blue: #054f90;
  --lmh-orange: #f58220;
  --lmh-blue-ink: #043d70;    /* ปุ่มหลักตอน hover */
  --ink: #142339;            /* ตัวอักษร: น้ำเงินเกือบดำ */
  --ink-2: #364459;
  --muted: #5f6b7e;
  --faint: #8ea3c0;          /* บรรทัดแรกของหัวข้อสองโทน (ฟ้าเทา) */
  --line: #e3e9f1;
  --line-strong: #cfd9e6;
  --paper: #ffffff;
  --panel: #eef3f9;
  --canvas: #f6f9fc;
  --night: #072c55;          /* ส่วนพื้นเข้ม: น้ำเงินโลโก้เข้ม */
  --night-2: #0b3a6c;

  /* โทนอ่อนของสีโลโก้ (ใช้เป็นพื้นชิป/สถานะ — อ่อนกว่าพาสเทลเดิม ให้เข้ากับโทนเทา) */
  --p-pink: #fde8e8;
  --p-blue: #e6eef8;
  --p-peach: #fef0e2;
  --p-mint: #e4f5ea;
  --p-lav: #eeeef3;

  /* กระจก */
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-line: rgba(255, 255, 255, .7);
  --glass-dark: rgba(7, 44, 85, .55);
  --blur: saturate(160%) blur(18px);
  --shadow-sm: 0 1px 2px rgba(16, 17, 20, .04), 0 4px 14px rgba(16, 17, 20, .05);
  --shadow-md: 0 2px 6px rgba(16, 17, 20, .04), 0 18px 44px rgba(16, 17, 20, .09);
  --shadow-lg: 0 30px 80px rgba(16, 17, 20, .16);

  --ink-t: #eaf0f7;
  --ease: cubic-bezier(.22, .8, .3, 1);
  --r-lg: 32px;
  --r-md: 22px;
  --r-sm: 16px;
  --mono: ui-monospace, "SF Mono", "Chivo Mono", Menlo, Consolas, "Sarabun", monospace;

  --bs-body-font-family: "Sarabun", "Noto Sans Thai", "Thonburi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.7;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-border-radius: .9rem;
  --bs-border-radius-lg: 1.25rem;
  --bs-primary: var(--lmh-blue);
  --bs-primary-rgb: 5, 79, 144;
  --bs-link-color: var(--ink);
  --bs-link-color-rgb: 20, 35, 57;
  --bs-link-hover-color: var(--lmh-red-ink);
  --bs-heading-color: var(--ink);
}

html { scroll-behavior: smooth; font-size: 15.5px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -.02em; line-height: 1.25; text-wrap: balance; }
p { text-wrap: pretty; }
a { text-decoration: none; text-underline-offset: .22em; transition: color .2s; }
p a, .state a, .crumbs a:hover, .site-footer a:not(.btn):hover { text-decoration: underline; }
::selection { background: var(--p-pink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.text-secondary { color: var(--muted) !important; }
.fw-semibold { font-weight: 600 !important; }
.display-6 { font-size: clamp(1.8rem, 4vw, 2.75rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.18; }
.display-6 .soft, .two-tone .soft { color: var(--faint); display: block; }

/* ---- ป้ายเล็ก: เม็ดยากระจกมีจุดสีแดง ----------------------------------------- */
.mono { font-family: var(--mono); font-size: .74rem; letter-spacing: .02em; text-transform: uppercase; font-weight: 400; }
.lbl { display: inline-flex; align-items: center; gap: .5rem; width: fit-content; padding: .3rem .85rem .3rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 500; letter-spacing: 0; color: var(--ink-2);
  background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.lbl::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lmh-red); flex: none; }
.lbl.d-block { display: inline-flex !important; }

/* ---- Icons --------------------------------------------------------------- */
.icon { width: 1em; height: 1em; fill: currentColor; vertical-align: -.14em; flex: none; }
.icon-lg { width: 1.35em; height: 1.35em; }
.icon-xl { width: 1.75em; height: 1.75em; }
.icon-chip { --t: var(--ink-t); width: 48px; height: 48px; flex: none; display: inline-grid; place-items: center; border-radius: 16px; color: var(--ink); background: var(--t); font-size: 1.3rem; transition: transform .35s var(--ease); }
.icon-chip.sm { width: 36px; height: 36px; border-radius: 12px; font-size: 1.05rem; }
.icon-chip.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 1.7rem; }
.is-red { --t: var(--p-pink); }
.is-blue { --t: var(--p-blue); }
.is-orange { --t: var(--p-peach); }
.is-green { --t: var(--p-mint); }
.is-lav { --t: var(--p-lav); }
.is-ink { --t: var(--ink-t); }

/* ---- Buttons: ปุ่มหลักดำทรงเม็ดยา ปุ่มรองเส้นบาง ------------------------------ */
.btn { --bs-btn-border-radius: 999px; --bs-btn-padding-x: 1.35rem; --bs-btn-padding-y: .62rem; --bs-btn-font-weight: 500; --bs-btn-border-width: 1px;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; letter-spacing: -.005em; transition: background-color .2s, border-color .2s, color .2s, transform .25s var(--ease); }
.btn:active { transform: scale(.98); }
.btn-lg { --bs-btn-padding-x: 1.5rem; --bs-btn-padding-y: .72rem; --bs-btn-font-size: 1rem; }
.btn-sm { --bs-btn-padding-x: .95rem; --bs-btn-padding-y: .36rem; --bs-btn-font-size: .9rem; }
/* บทบาทสี: แดง = ปุ่มกดหลัก · ฟ้าอ่อน/น้ำเงิน = สิ่งที่เลือกอยู่ · น้ำเงินเข้ม = พื้นการ์ดเข้มเท่านั้น (ปุ่มบนพื้นเข้มเป็นสีขาว) */
.btn-primary, .btn-dark { --bs-btn-color: #fff; --bs-btn-bg: var(--lmh-red); --bs-btn-border-color: var(--lmh-red);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--lmh-red-ink); --bs-btn-hover-border-color: var(--lmh-red-ink);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #95171a; --bs-btn-active-border-color: #95171a;
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #b9a3a4; --bs-btn-disabled-border-color: #b9a3a4; --bs-btn-focus-shadow-rgb: 208, 32, 35;
  box-shadow: 0 6px 16px rgba(208, 32, 35, .22); }
/* หลังบ้าน: ปุ่มบันทึกเป็นน้ำเงิน จะได้ไม่สับสนกับปุ่มลบ (แดง) */
.is-admin .btn-primary, .is-admin .btn-dark { --bs-btn-bg: var(--lmh-blue); --bs-btn-border-color: var(--lmh-blue); --bs-btn-hover-bg: var(--lmh-blue-ink); --bs-btn-hover-border-color: var(--lmh-blue-ink);
  --bs-btn-active-bg: var(--night); --bs-btn-active-border-color: var(--night); --bs-btn-disabled-bg: #8b98ab; --bs-btn-disabled-border-color: #8b98ab; --bs-btn-focus-shadow-rgb: 5, 79, 144; box-shadow: none; }
.btn-primary:hover, .btn-dark:hover { transform: translateY(-2px); }
.btn-outline-primary, .btn-outline-dark, .btn-outline-secondary, .btn-light { --bs-btn-color: var(--ink); --bs-btn-bg: transparent; --bs-btn-border-color: rgba(5, 79, 144, .28);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--panel); --bs-btn-hover-border-color: var(--ink);
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--line); --bs-btn-active-border-color: var(--ink);
  --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-border-color: var(--line); }
.btn-outline-danger { --bs-btn-color: #b3261e; --bs-btn-border-color: rgba(179, 38, 30, .4); --bs-btn-hover-color: #b3261e; --bs-btn-hover-bg: #fdecea; --bs-btn-hover-border-color: #b3261e; --bs-btn-active-bg: #fad9d6; --bs-btn-active-color: #b3261e; --bs-btn-active-border-color: #b3261e; }
.btn-success { --bs-btn-color: var(--ink); --bs-btn-bg: var(--p-mint); --bs-btn-border-color: var(--p-mint); --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: #b9f58f; --bs-btn-hover-border-color: #b9f58f; --bs-btn-active-color: var(--ink); --bs-btn-active-bg: #a6ea78; --bs-btn-active-border-color: #a6ea78; }
.btn-glass { --bs-btn-color: var(--ink); --bs-btn-bg: var(--glass-strong); --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: var(--ink);
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: #fff; --bs-btn-active-border-color: var(--ink);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.btn-white { --bs-btn-color: var(--ink); --bs-btn-bg: #fff; --bs-btn-border-color: #fff; --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: #eaf0f7; --bs-btn-hover-border-color: #eaf0f7; --bs-btn-active-bg: #dde6f1; --bs-btn-active-color: var(--ink); }
.btn-ghost-light { --bs-btn-color: #fff; --bs-btn-bg: rgba(255,255,255,.06); --bs-btn-border-color: rgba(255,255,255,.22); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: rgba(255,255,255,.14); --bs-btn-hover-border-color: rgba(255,255,255,.5); --bs-btn-active-color: #fff; --bs-btn-active-bg: rgba(255,255,255,.18); }
.btn-link { --bs-btn-border-width: 0; --bs-btn-color: var(--ink-2); --bs-btn-hover-color: var(--ink); text-decoration: none; }
.btn .icon { transition: transform .25s var(--ease); }
.btn:hover .icon-arrow { transform: translateX(3px); }
.btn-circle { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-grid; place-items: center; font-size: .72rem; }
.link-dash { position: relative; display: inline-flex; align-items: center; gap: .5rem; padding-bottom: .35rem; color: var(--ink); font-weight: 500; }
.link-dash::after { content: ""; position: absolute; left: 0; bottom: 0; width: 22px; height: 1.5px; background: var(--lmh-red); transition: width .35s var(--ease); }
.link-dash:hover { color: var(--ink); } .link-dash:hover::after { width: 100%; }

/* ---- Forms --------------------------------------------------------------- */
.form-control, .form-select { border: 1px solid var(--line-strong); border-radius: 14px; padding: .65rem .95rem; background-color: var(--paper); transition: border-color .15s, box-shadow .15s; }
.form-control-lg { padding: .8rem 1.05rem; font-size: 1.05rem; }
.form-control:focus, .form-select:focus { border-color: var(--ink); box-shadow: 0 0 0 .2rem rgba(30, 30, 30, .08); }
.input-group-text { background: var(--paper); border: 1px solid var(--line-strong); color: var(--muted); border-radius: 14px; }
.input-group > .input-group-text + .form-control { border-left: 0; padding-left: .2rem; }
.input-group:focus-within > .input-group-text, .input-group:focus-within > .btn { border-color: var(--ink); color: var(--ink); }
.input-group:focus-within > .form-control { box-shadow: none; }
.input-group:focus-within { border-radius: 14px; box-shadow: 0 0 0 .2rem rgba(22, 23, 26, .08); }
.pw-toggle { --bs-btn-bg: var(--paper); --bs-btn-border-color: var(--line-strong); border-left: 0; }
.input-group > .form-control:not(:first-child), .input-group > .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .input-group-text:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .btn { border-radius: 0 14px 14px 0; }
.form-label { font-weight: 500; font-size: .92rem; margin-bottom: .35rem; color: var(--ink-2); }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.form-check-input:focus { border-color: var(--ink); box-shadow: 0 0 0 .2rem rgba(30, 30, 30, .1); }
.form-text { color: var(--muted); }

/* ---- Surfaces ------------------------------------------------------------ */
.surface { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.surface-soft { background: var(--panel); border-radius: var(--r-md); }
.panel { background: var(--panel); border-radius: var(--r-lg); }
.glass { background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow-md); }
.hover-lift { transition: transform .45s var(--ease), box-shadow .35s, border-color .25s; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.hover-lift:hover .icon-chip { transform: rotate(-8deg) scale(1.06); }
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section-canvas { background: var(--canvas); }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--mono); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.eyebrow::before { content: "( "; white-space: pre; } .eyebrow::after { content: " )"; white-space: pre; }
.eyebrow .icon { display: none; }
.section-head { max-width: 760px; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.035em; line-height: 1.08; margin-top: 1rem; }
.badge { font-weight: 500; letter-spacing: 0; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 500; letter-spacing: 0; color: var(--ink); background: var(--t, var(--panel)); }

/* ---- Navbar -------------------------------------------------------------- */
/* navbar ลอยเป็นเม็ดยากระจก — เบลอวางที่ ::before (ห้ามใส่ backdrop-filter ที่ตัว element:
   จะกลายเป็น containing block ขัง dropdown/overlay ที่เป็น position: fixed) */
.site-nav { position: sticky; top: 0; z-index: 1050; padding: .75rem 0 0; pointer-events: none; }
.site-nav > .container { position: relative; pointer-events: auto; padding: .5rem .6rem .5rem 1.1rem; border-radius: 999px; transition: box-shadow .35s var(--ease); }
.site-nav > .container::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--glass); border: 1px solid transparent; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: background-color .35s, border-color .35s; }
.site-nav.is-scrolled > .container { box-shadow: var(--shadow-md); }
.site-nav.is-scrolled > .container::before { background: var(--glass-strong); border-color: var(--glass-line); }
@media (max-width: 575.98px) { .site-nav { padding-top: .5rem; } .site-nav > .container { width: calc(100% - 1rem); } }
.site-nav .navbar-brand { padding: 0; margin-right: 1.5rem; }
.site-nav .navbar-brand img { height: 36px; width: auto; }
.announce + .site-nav { padding-top: .5rem; }
.announce { background: var(--night); color: #fff; text-align: center; font-size: .88rem; padding: .45rem 1rem; }
.nav-inline { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nav-inline .nav-link { display: inline-flex; align-items: center; padding: .4rem .8rem; color: var(--ink-2); font-weight: 500; font-size: .93rem; border-radius: 999px; transition: background-color .2s, color .2s; }
.nav-inline .nav-link:hover { background: var(--panel); color: var(--ink); }
.nav-inline .nav-link.active { background: var(--p-blue); color: var(--lmh-blue); font-weight: 600; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: .95rem; color: var(--ink); background: var(--p-blue); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 50px rgba(20, 24, 31, .12); padding: .4rem; }
.dropdown-item { border-radius: 12px; display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; font-weight: 500; }
.dropdown-item:active { background: var(--panel); color: var(--ink); }
.menu-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--ink); position: relative; }
.menu-btn::before, .menu-btn::after { content: ""; position: absolute; width: 22px; height: 1.5px; background: currentColor; transition: transform .45s var(--ease); }
.menu-btn::after { transform: rotate(90deg); }
.menu-btn[aria-expanded="true"]::before { transform: rotate(45deg); } .menu-btn[aria-expanded="true"]::after { transform: rotate(-45deg); }

/* เมนูเต็มจอแบบ Bungee (มือถือ/แท็บเล็ต) */
.menu-overlay { position: fixed; inset: 0; z-index: 1040; background: rgba(255, 255, 255, .93); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); padding: 6rem 1.5rem 2rem; overflow-y: auto; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transition: opacity .45s var(--ease), visibility .45s; }
.menu-overlay.is-open { opacity: 1; visibility: visible; }
.menu-overlay nav a { display: flex; align-items: baseline; gap: .9rem; padding: .4rem 0; font-size: clamp(1.7rem, 7vw, 2.5rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.12; color: var(--ink); transform: translateY(16px); opacity: 0; transition: transform .6s var(--ease), opacity .6s var(--ease); transition-delay: calc(var(--i, 0) * 60ms + 120ms); }
.menu-overlay.is-open nav a { transform: none; opacity: 1; }
.menu-overlay nav a .mono { font-size: .72rem; color: var(--muted); }
.menu-overlay nav a.active { color: var(--lmh-red-ink); }
.menu-overlay > .container { display: flex; flex-direction: column; flex: 1; }
.menu-foot { margin-top: auto; padding-top: 2rem; }
body.menu-open { overflow: hidden; }

/* Bottom tab bar (มือถือ) */
/* Bottom tab bar (มือถือ): เม็ดยากระจกลอย เมนูที่เลือกมีพื้นเทาโค้ง */
.tabbar { --tab-h: 66px; position: fixed; z-index: 1030; left: 50%; bottom: calc(.75rem + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(380px, calc(100% - 3rem)); height: var(--tab-h);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; padding: .35rem; border-radius: 999px;
  background: rgba(255, 255, 255, .9); border: 1px solid rgba(22, 23, 26, .05); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 10px 30px rgba(16, 17, 20, .12), 0 2px 6px rgba(16, 17, 20, .06); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; border-radius: 999px; font-size: .72rem; font-weight: 500; line-height: 1.1; color: var(--muted);
  transition: background-color .3s var(--ease), color .2s; -webkit-tap-highlight-color: transparent; }
.tabbar a .icon { font-size: 1.4rem; transition: transform .3s var(--ease); }
.tabbar a:active .icon { transform: scale(.88); }
.tabbar a.active { background: var(--p-blue); color: var(--ink); font-weight: 600; }
@media (max-width: 767.98px) { body.has-tabbar { padding-bottom: calc(64px + 2rem + env(safe-area-inset-bottom)); } }
body.menu-open .tabbar { display: none; }

/* ---- แสงฟุ้งสีโลโก้ (ใช้เป็นฉากหลังของส่วนต่างๆ) ------------------------------- */
.glow { position: absolute; z-index: 0; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; }
.glow.red { background: var(--lmh-red); } .glow.blue { background: var(--lmh-blue); } .glow.orange { background: var(--lmh-orange); }
.glow.gray { background: #c6d4e6; opacity: .8; }

/* ---- Hero: โลโก้ + หัวข้อกลางจอ + จุดเด่น + แถวภาพประกอบ ------------------------- */
.hero { position: relative; overflow: hidden; padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
body { background: linear-gradient(180deg, var(--canvas) 0, var(--paper) 760px) no-repeat; }
.hero .glow.blue { width: 40vw; height: 40vw; left: 30vw; top: -20vw; opacity: .14; }
.hero .glow.red { width: 22vw; height: 22vw; left: 4vw; top: 20%; opacity: .1; }
.hero .glow.orange { width: 20vw; height: 20vw; right: 4vw; top: 30%; opacity: .1; }
.hero-inner { position: relative; z-index: 2; max-width: 46rem; margin-inline: auto; text-align: center; }
.hero-logo { display: block; width: clamp(150px, 22vw, 220px); height: auto; margin: 0 auto; }
.hero-title { font-size: clamp(2.1rem, 5.6vw, 4rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.15; margin: 1.1rem 0 0; color: var(--night); }
.hero-title .soft { color: var(--lmh-blue); font-weight: 600; }
.hero-title .accent { color: var(--lmh-red); }
.hero-tag { font-size: clamp(1.05rem, 1.7vw, 1.2rem); color: var(--ink-2); max-width: 36rem; margin: 1.1rem auto 0; }
.hero-tag strong { color: var(--lmh-red); font-weight: 600; }
.creds { list-style: none; padding: 0; margin: .7rem auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.creds li { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .85rem; border-radius: 999px; font-size: .9rem; color: var(--ink-2); background: var(--glass-strong); border: 1px solid var(--line); }
.creds .icon { color: var(--lmh-blue); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; margin-top: 1.8rem; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; max-width: 40rem; margin: 2.2rem auto 0; }
.tile-n { padding: .9rem .5rem .8rem; border-radius: 18px; text-align: center; }
.tile-n b { display: block; font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.tile-n span { display: block; font-size: .78rem; color: var(--muted); margin-top: .25rem; line-height: 1.3; }
.tiles .tile-n { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1rem .6rem; }
.tiles .tile-n > span:last-child { font-size: .92rem; font-weight: 500; color: var(--ink); margin: 0; line-height: 1.35; }
.tiles .tile-n > .icon-chip { margin: 0; display: inline-grid; color: var(--ink); }
@media (max-width: 575.98px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

/* แถวภาพประกอบ 4 ภาพ (เอียงสลับเล็กน้อย) — มือถือเป็น 2×2 */
.hero-gallery { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(.6rem, 1.6vw, 1.25rem); max-width: 60rem; margin: clamp(2.2rem, 5vw, 3.5rem) auto 0; }
.hero-gallery figure { margin: 0; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: var(--shadow-md); transform: rotate(calc((var(--i) - 1.5) * 1.6deg)); transition: transform .5s var(--ease); }
.hero-gallery figure:nth-child(even) { margin-top: 1.5rem; }
.hero-gallery figure:hover { transform: rotate(0) translateY(-4px); }
.hero-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 1055 / 1491; object-fit: cover; }
@media (max-width: 767.98px) { .hero-gallery { grid-template-columns: repeat(2, 1fr); } .hero-gallery figure:nth-child(even) { margin-top: 1rem; } }

/* โปสเตอร์คอร์ส */
.posters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2rem); max-width: 44rem; margin-inline: auto; }
.poster { position: relative; display: block; border-radius: var(--r-md); overflow: hidden; background: var(--panel); box-shadow: var(--shadow-md); color: var(--ink); }
.poster img { display: block; width: 100%; height: auto; aspect-ratio: 720 / 1018; object-fit: cover; transition: transform .8s var(--ease); }
.poster:hover img { transform: scale(1.03); }
.poster-go { position: absolute; left: .75rem; right: .75rem; bottom: .75rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; border-radius: 16px; font-weight: 600;
  background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-line); }
.poster-go .icon { width: 34px; height: 34px; flex: none; padding: 8px; border-radius: 50%; background: var(--lmh-blue); color: #fff; transition: transform .35s var(--ease); }
.poster:hover { color: var(--ink); }
.poster:hover .poster-go .icon { transform: rotate(45deg); }
@media (max-width: 575.98px) { .poster-go { font-size: .85rem; padding: .55rem .7rem; } .poster-go .icon { width: 28px; height: 28px; padding: 6px; } }

/* ช่องทางติดตาม */
.follow-list { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; max-width: 46rem; }
.follow { display: inline-flex; align-items: center; gap: .55rem; padding: .7rem 1.2rem; border-radius: 999px; color: #fff; font-weight: 500;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); transition: background .2s, color .2s, transform .3s var(--ease); }
.follow .icon { font-size: 1.2rem; }
.follow:hover { color: var(--night); background: #fff; transform: translateY(-2px); }
.follow-line { margin: 1.6rem 0 0; color: rgba(255, 255, 255, .75); }

/* ---- ส่วนพื้นเข้ม + การ์ดขาวใหญ่ซ้อนทับ ----------------------------------------- */
.night { position: relative; overflow: hidden; background: var(--night); color: #fff; border-radius: var(--r-lg); margin-inline: clamp(.5rem, 1.5vw, 1.25rem); padding: clamp(3.5rem, 8vw, 6rem) 0; }
.night .glow.red { width: 30vw; height: 30vw; left: -8vw; top: -8vw; opacity: .28; }
.night .glow.blue { width: 34vw; height: 34vw; right: -10vw; bottom: -12vw; opacity: .3; }
.night > .container { position: relative; z-index: 1; }
.night h2 { color: #fff; }
.night .text-secondary, .night .muted-l { color: rgba(255, 255, 255, .62) !important; }
.night .lbl { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .85); box-shadow: none; }
.sheet { background: #fff; color: var(--ink); border-radius: calc(var(--r-lg) - 6px); padding: clamp(1.5rem, 5vw, 4rem); box-shadow: 0 40px 100px rgba(0, 0, 0, .35); }
.sheet h2 { color: var(--ink); }
.sheet .text-secondary { color: var(--muted) !important; }

.cta-end + * , main:has(.cta-end:last-child) + .site-footer { margin-top: clamp(.5rem, 1.5vw, 1.25rem); }

/* feature row ใน sheet: ภาพกระจกฝั่งหนึ่ง ข้อความอีกฝั่ง */
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; padding-block: clamp(1.5rem, 4vw, 3rem); }
.feat + .feat { border-top: 1px solid var(--line); }
.feat:nth-child(even) .feat-art { order: 2; }
.feat h3 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); letter-spacing: -.025em; margin-bottom: .6rem; }
.feat p { color: var(--muted); margin: 0; max-width: 28rem; }
.feat-art { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--canvas); display: grid; place-items: center; isolation: isolate; }
.feat-art .glow { filter: blur(40px); opacity: .35; }
.feat-art .glass { position: relative; z-index: 1; border-radius: 18px; }
@media (max-width: 767.98px) { .feat { grid-template-columns: 1fr; } .feat:nth-child(even) .feat-art { order: 0; } }

/* ชิ้นส่วน UI จำลองในภาพประกอบ */
.ui-pill { display: flex; align-items: center; gap: .65rem; padding: .6rem 1rem .6rem .6rem; border-radius: 999px; font-size: .88rem; line-height: 1.3; }
.ui-pill small { display: block; color: var(--muted); font-size: .74rem; }
.ui-big { font-size: clamp(3.5rem, 9vw, 6rem); font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.ui-stack { display: grid; gap: .6rem; width: min(80%, 300px); }
.ui-note { padding: 1rem 1.1rem; font-size: .88rem; line-height: 1.55; width: min(82%, 320px); text-align: left; }
.ui-note .ts { display: inline-block; font-family: var(--mono); font-size: .76rem; padding: .05rem .45rem; border-radius: 6px; background: var(--lmh-blue); color: #fff; margin-right: .35rem; }

/* ---- คอร์ส ------------------------------------------------------------------ */
.course-card { display: flex; flex-direction: column; height: 100%; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: .55rem .55rem 1.1rem; box-shadow: var(--shadow-sm); transition: transform .45s var(--ease), box-shadow .35s; }
.course-card:hover { color: var(--ink); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.course-card .cap, .course-card > p, .course-card .meta { padding-inline: .6rem !important; }
.cover { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; background-color: var(--t, var(--panel)); border-radius: calc(var(--r-md) - 6px); overflow: hidden; }
.cover .big { position: relative; font-size: 3rem; color: var(--ink); transition: transform .6s var(--ease); }
.course-card:hover .cover .big { transform: scale(1.12) rotate(-6deg); }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.course-card:hover .cover img { transform: scale(1.05); }
.cover .tag { position: absolute; left: 1rem; top: 1rem; background: var(--paper); }
.cap { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1rem .35rem 0; }
.cap h3 { font-size: 1.08rem; margin: 0; letter-spacing: -.02em; }
.meta { display: flex; flex-wrap: wrap; gap: .35rem 1rem; color: var(--muted); font-size: .88rem; }
.meta .icon { margin-right: .3rem; }
.price { font-weight: 500; font-size: 1.15rem; letter-spacing: -.02em; }
.price small { font-weight: 400; color: var(--muted); font-size: .8rem; }

/* ---- Subject photo cards: ภาพเต็มการ์ด + แถบกระจกด้านล่าง ------------------------ */
.subject { position: relative; display: block; border-radius: var(--r-md); overflow: hidden; color: var(--ink); aspect-ratio: 16 / 11; background: var(--panel); box-shadow: var(--shadow-sm); }
.subject:hover { color: var(--ink); }
.subject .ph { position: absolute; inset: 0; }
.subject .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.subject:hover .ph img { transform: scale(1.05); }
.subject .body { position: absolute; left: .75rem; right: .75rem; bottom: .75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-radius: 18px; }
.subject h3 { font-size: clamp(1.05rem, 2vw, 1.35rem); margin: .1rem 0 0; }
.subject .go { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; transition: transform .35s var(--ease); }
.subject:hover .go { transform: rotate(45deg); }

.tile { display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.25rem; color: var(--ink); height: 100%; position: relative; }
.tile h3 { font-size: 1.08rem; margin: 0; }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.tile .go { margin-left: auto; color: var(--muted); transition: transform .3s var(--ease), color .2s; }
.tile:hover .go { transform: translate(3px, -3px); color: var(--ink); }
.tile.is-soon { border-style: dashed; background: transparent; }
a.tile:hover { color: var(--ink); }

/* Steps: การ์ดเทาอ่อน เลขในวงกลม ขั้นสุดท้ายเป็นสีเข้ม */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.step { position: relative; padding: 1.5rem 1.4rem 1.6rem; border-radius: var(--r-md); background: var(--canvas); border: 1px solid var(--line); }
.step-n { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: #fff; border: 1px solid var(--line-strong); }
.step h3 { font-size: 1.1rem; margin: 1.1rem 0 .35rem; }
.step p { color: var(--muted); font-size: .95rem; margin: 0; }
.step.is-last { background: var(--night); border-color: var(--night); color: #fff; }
.step.is-last h3 { color: #fff; } .step.is-last p { color: rgba(255,255,255,.65); }
.step.is-last .step-n { background: var(--lmh-red); border-color: var(--lmh-red); color: #fff; }
@media (max-width: 991.98px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .steps { grid-template-columns: 1fr; } }

/* mini calendar / file visuals */
.mini-cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; }
.mini-cal span { aspect-ratio: 1; border-radius: 5px; background: var(--ink-t); }
.mini-cal span.l1 { background: var(--p-blue); } .mini-cal span.l2 { background: #a9c6ec; } .mini-cal span.l3 { background: #5b8fd0; }
.mini-file { display: flex; align-items: center; gap: .65rem; padding: .55rem .8rem; border-radius: 14px; background: var(--paper); font-size: .9rem; font-weight: 500; }
.mini-file + .mini-file { margin-top: .5rem; }

/* ---- Auth ---------------------------------------------------------------- */
.auth { position: relative; isolation: isolate; min-height: calc(100vh - 150px); display: grid; align-items: center; padding-block: 2rem 3rem; }
.auth::before, .auth::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.auth::before { width: 34vw; height: 34vw; left: -6vw; top: 8%; background: var(--lmh-red); opacity: .1; }
.auth::after { width: 36vw; height: 36vw; right: -8vw; bottom: 0; background: var(--lmh-blue); opacity: .1; }
.auth-shell { border-radius: var(--r-lg); background: var(--glass-strong); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.03em; }
.auth-alt { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.auth > .row { width: 100%; }  /* ไอเท็มใน grid ที่มี margin:auto จะหดตามเนื้อหา ต้องกำหนดความกว้างเต็ม */
.auth-photo { position: relative; height: 170px; border-radius: calc(var(--r-lg) - 10px); overflow: hidden; background: var(--panel); }
.auth-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-photo-cap { position: absolute; left: .9rem; right: .9rem; bottom: .9rem; background: var(--glass-strong); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-radius: 20px; padding: 1.1rem 1.2rem; }
.auth-photo-cap p { font-size: 1.05rem; line-height: 1.45; }
@media (min-width: 992px) { .auth-photo { height: 100%; min-height: 560px; } }
.auth-side li { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1.2rem; }
.auth-side li strong { display: block; font-size: 1rem; font-weight: 500; }
.auth-side li span { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.auth-card { padding: clamp(1.5rem, 4vw, 2.6rem); }

/* ---- Course detail ------------------------------------------------------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); }
.crumbs .icon { font-size: .7rem; opacity: .6; }
.crumbs a { color: var(--ink-2); display: inline-flex; align-items: center; gap: .35rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.fact { display: flex; gap: .7rem; align-items: center; padding: .85rem 1rem; }
.fact b { display: block; line-height: 1.2; font-weight: 500; }
.fact span { color: var(--muted); font-size: .85rem; }
.buy { position: sticky; top: 96px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .65rem; align-items: flex-start; padding: .35rem 0; color: var(--ink-2); font-size: .97rem; }
.checklist .icon { color: var(--ink); margin-top: .3rem; font-size: 1.05rem; }
.accordion { --bs-accordion-bg: transparent; --bs-accordion-border-color: var(--line); --bs-accordion-border-radius: 0; --bs-accordion-inner-border-radius: 0;
  --bs-accordion-btn-bg: transparent; --bs-accordion-active-bg: transparent; --bs-accordion-active-color: var(--ink); --bs-accordion-btn-focus-box-shadow: none; --bs-accordion-btn-padding-y: 1.25rem; --bs-accordion-btn-padding-x: 0; --bs-accordion-body-padding-x: 0; }
.accordion-item { border-width: 0 0 1px; background: transparent; }
.accordion-item:first-of-type { border-top: 1px solid var(--line); }
.accordion-button { font-weight: 500; gap: .65rem; font-size: 1.02rem; letter-spacing: -.015em; }
.accordion-button:not(.collapsed) { box-shadow: none; }
.accordion-button::after { background-size: 1rem; }
.accordion.is-split .accordion-item { border-radius: 0 !important; margin: 0; border: 0; border-bottom: 1px solid var(--line); }
.accordion.is-split .accordion-item:first-of-type { border-top: 1px solid var(--line); }
.accordion.is-cards .accordion-item { border: 1px solid var(--line) !important; border-radius: 18px !important; background: var(--paper); margin-bottom: .6rem; overflow: hidden; transition: box-shadow .3s; }
.accordion.is-cards .accordion-item:has(.show) { box-shadow: var(--shadow-sm); }
.accordion.is-cards .accordion-button { padding-inline: 1.3rem; }
.accordion.is-cards .accordion-body { padding-inline: 1.3rem; }
.lesson-line { display: flex; align-items: center; gap: .75rem; padding: .8rem 0; border-top: 1px solid var(--line); font-size: .98rem; }
.lesson-line:first-child { border-top: 0; }
.lesson-line .t { flex: 1; }

/* ---- Learning ------------------------------------------------------------ */
.ring { --p: 0; --s: 52px; position: relative; width: var(--s); height: var(--s); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--ink); stroke-linecap: round; stroke-dasharray: calc(var(--p) * 1.131) 113.1; transition: stroke-dasharray .9s var(--ease); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .76rem; font-weight: 600; }
.progress { --bs-progress-height: .4rem; --bs-progress-bg: var(--line); --bs-progress-border-radius: 999px; --bs-progress-bar-bg: var(--lmh-blue); }
.progress-bar { transition: width .8s var(--ease); }
.continue-card { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; padding: 1.5rem 1.6rem; background: var(--night); color: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.continue-card::before { content: ""; position: absolute; z-index: -1; width: 260px; height: 260px; right: -60px; top: -120px; border-radius: 50%; background: var(--lmh-red); filter: blur(70px); opacity: .35; }
.continue-card .icon-chip { background: rgba(255, 255, 255, .1); color: #fff; }
.continue-card .lbl { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.85); box-shadow: none; }
.continue-card .small { color: rgba(255,255,255,.65); }
.continue-card .btn-dark { box-shadow: none; --bs-btn-bg: #fff; --bs-btn-color: var(--ink); --bs-btn-border-color: #fff; --bs-btn-hover-bg: #ececee; --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #ececee; }
/* หน้าเรียน: วิดีโอแบบป้องกันลิงก์ (iframe ไม่รับเมาส์ + แผ่นใสทับ + แถบปุ่มของเรา) */
.pl-stage { position: relative; }
.player-frame { position: relative; aspect-ratio: 16 / 9; background: #0b1424; border-radius: var(--r-md) var(--r-md) 0 0; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.player-frame iframe, .player-frame #yt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.pl-shield { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.pl-guard { position: absolute; left: 0; right: 0; z-index: 3; height: 24%; }   /* กันแถบชื่อคลิป (บน) และโลโก้/วิดีโอแนะนำ (ล่าง) */
.pl-guard.is-top { top: 0; } .pl-guard.is-bottom { bottom: 0; }
.player-frame.tap-through iframe { pointer-events: auto; }
.player-frame.tap-through .pl-shield { display: none; }
.pl-bigplay { position: absolute; z-index: 4; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--lmh-red); color: #fff; font-size: 2.1rem; box-shadow: 0 12px 34px rgba(0, 0, 0, .35); transition: transform .25s var(--ease), background .2s; }
.pl-bigplay .icon { margin-left: 4px; }
.pl-bigplay:hover { transform: scale(1.08); background: var(--lmh-red-ink); }
.pl-bigplay[hidden], .pl-taphint[hidden], .pl-end[hidden] { display: none; }
.pl-taphint { position: absolute; z-index: 4; left: 50%; bottom: 26%; transform: translateX(-50%); padding: .35rem .9rem; border-radius: 999px; font-size: .85rem; white-space: nowrap; color: #fff; background: rgba(7, 44, 85, .8); pointer-events: none; }
.pl-wm { position: absolute; z-index: 3; pointer-events: none; font-size: clamp(.7rem, 1.4vw, .9rem); font-weight: 500; color: rgba(255, 255, 255, .5); text-shadow: 0 1px 2px rgba(0, 0, 0, .45); white-space: nowrap; transition: left 2.5s var(--ease), top 2.5s var(--ease); }
.pl-end { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; color: #fff; font-size: 1.15rem; font-weight: 500; background: rgba(7, 44, 85, .96); }

.player-bar { display: flex; flex-direction: column; gap: .35rem; padding: .55rem .75rem .65rem; background: var(--night); color: #fff; border-radius: 0 0 var(--r-md) var(--r-md); }
.pl-seek, .pl-tools { display: flex; align-items: center; gap: .5rem; }
.pl-tools { flex-wrap: wrap; gap: .25rem .4rem; }
.pl-btn { display: inline-flex; align-items: center; gap: .35rem; height: 36px; min-width: 36px; padding: 0 .6rem; border: 0; border-radius: 999px; background: transparent; color: #fff; font-size: .88rem; justify-content: center; transition: background .15s; }
.pl-btn .icon { font-size: 1.1rem; }
.pl-btn:hover { background: rgba(255, 255, 255, .12); }
.pl-btn.is-main { background: #fff; color: var(--night); width: 38px; padding: 0; }
.pl-btn.is-main:hover { background: #e6edf6; }
.pl-time { font-size: .8rem; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .8); min-width: 2.6rem; text-align: center; }
.pl-range { --p: 0%; flex: 1; min-width: 0; height: 18px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.pl-range::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: linear-gradient(to right, var(--lmh-red) var(--p), rgba(255, 255, 255, .25) var(--p)); }
.pl-range::-moz-range-track { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .25); }
.pl-range::-moz-range-progress { height: 5px; border-radius: 999px; background: var(--lmh-red); }
.pl-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4.5px; border-radius: 50%; background: #fff; border: 0; }
.pl-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.player-bar .pl-rate { color: rgba(255, 255, 255, .75); }
.player-bar .pl-rate .form-select { background-color: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }
.player-bar .pl-rate option { color: var(--ink); }
@media (max-width: 575.98px) { .pl-btn span { display: none; } }

/* เต็มจอ: วิดีโอเต็มพื้นที่ แถบปุ่มอยู่ล่าง (iPhone ใช้ .is-fake-full) */
.pl-stage:fullscreen, .pl-stage:-webkit-full-screen, .pl-stage.is-fake-full { display: flex; flex-direction: column; justify-content: center; width: 100%; height: 100%; background: #000; }
.pl-stage.is-fake-full { position: fixed; inset: 0; z-index: 2000; height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.pl-stage:fullscreen .player-frame, .pl-stage:-webkit-full-screen .player-frame, .pl-stage.is-fake-full .player-frame { flex: 1; min-height: 0; aspect-ratio: auto; border-radius: 0; }
.pl-stage:fullscreen .player-bar, .pl-stage:-webkit-full-screen .player-bar, .pl-stage.is-fake-full .player-bar { border-radius: 0; }
body.pl-lock { overflow: hidden; }
body.is-protected main { -webkit-user-select: none; user-select: none; }
body.is-protected textarea, body.is-protected input { -webkit-user-select: text; user-select: text; }
.lesson-panel { max-height: calc(100vh - 150px); display: flex; flex-direction: column; overflow: hidden; }
.lesson-scroll { overflow: auto; padding: .5rem; }
.sec-title { padding: .9rem .9rem .3rem; font-size: .8rem; font-weight: 600; color: var(--lmh-blue); }
.lesson-item { display: flex; gap: .7rem; align-items: center; padding: .6rem .8rem; border-radius: 16px; color: var(--ink-2); font-size: .92rem; line-height: 1.4; transition: background-color .15s; }
.lesson-item:hover { background: var(--panel); color: var(--ink); }
.lesson-item.active { background: var(--p-blue); color: var(--lmh-blue); font-weight: 600; box-shadow: inset 3px 0 0 var(--lmh-blue); }
.lesson-item .st { font-size: 1.15rem; color: var(--line-strong); }
.lesson-item.done .st { color: #2f8f5b; }
.lesson-item.active .st { color: var(--lmh-red); }
.lesson-item .d { font-size: .8rem; color: var(--muted); }
.lesson-item.active .d { color: var(--lmh-blue); }
.nav-tabs { --bs-nav-tabs-border-color: var(--line); --bs-nav-link-color: var(--muted); --bs-nav-link-hover-color: var(--ink); --bs-nav-tabs-border-radius: 0; border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link { font-weight: 500; display: inline-flex; align-items: center; gap: .45rem; border-width: 0 0 2px; border-color: transparent; margin-bottom: -1px; background: transparent; }
.nav-tabs .nav-link.active { color: var(--lmh-blue); border-color: var(--lmh-blue); background: transparent; }
.toast { --bs-toast-border-radius: 20px; --bs-toast-border-color: var(--line); --bs-toast-box-shadow: 0 18px 50px rgba(20, 24, 31, .16); }

.stat { padding: 1.25rem 1.4rem; display: flex; gap: .9rem; align-items: center; }
.stat .num { font-size: 1.5rem; font-weight: 500; line-height: 1.1; letter-spacing: -.03em; }
.stat .lbl2, .stat .lbl-s { color: var(--muted); font-size: .88rem; }
@media (max-width: 575.98px) { .stat { padding: 1rem; gap: .7rem; } .stat .num { font-size: 1.35rem; } .stat .icon-chip { width: 40px; height: 40px; } }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; }
.cal-dow { text-align: center; font-family: var(--mono); font-size: .72rem; text-transform: uppercase; color: var(--muted); padding-bottom: .2rem; }
.cal-day { aspect-ratio: 1; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .92rem; font-weight: 500; background: var(--canvas); position: relative; transition: transform .2s var(--ease); }
.cal-day:not(.empty):hover { transform: scale(1.06); }
.cal-day.empty { background: transparent; }
.cal-day.l1 { background: var(--p-blue); }
.cal-day.l2 { background: #a9c6ec; }
.cal-day.l3 { background: #5b8fd0; color: #fff; }
.cal-day.today { outline: 2px solid var(--ink); outline-offset: 2px; }
.cal-day small { font-size: .62rem; opacity: .8; line-height: 1; margin-top: 2px; }
.legend i { display: inline-block; width: 16px; height: 16px; border-radius: 5px; vertical-align: middle; }

/* ---- Checkout ------------------------------------------------------------ */
.stepper { display: inline-flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.75rem; padding: .45rem .9rem .45rem .45rem; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.stepper .s { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 500; color: var(--muted); }
.stepper .s .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); font-size: .8rem; background: var(--paper); }
.stepper .s.on { color: var(--ink); }
.stepper .s.on .n { border-color: var(--lmh-blue); background: var(--lmh-blue); color: #fff; }
.stepper .s.done .n { border-color: #2f8f5b; background: #2f8f5b; color: #fff; }
.stepper .bar { width: 22px; border-top: 1px solid var(--line-strong); }
.qr-box { background: var(--paper); border-radius: var(--r-md); padding: 1rem; display: inline-block; border: 1px solid var(--line); }
.qr-box svg { width: 232px; height: 232px; display: block; }
.drop-zone { display: block; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: 1.6rem; text-align: center; cursor: pointer; background: var(--canvas); transition: border-color .2s, background-color .2s; }
.drop-zone:hover, .drop-zone.drag { border-color: var(--ink); background: var(--panel); }
.drop-zone .icon-chip { margin-bottom: .6rem; }
.drop-zone.has-file { border-style: solid; border-color: #2f8f5b; background: #ecfbe3; }
.state { display: flex; gap: .8rem; align-items: flex-start; padding: .95rem 1.1rem; border-radius: 20px; }
.state.info { color: var(--ink); background: var(--p-blue); }
.state.ok { color: var(--ink); background: var(--p-mint); }
.state.bad { color: #7a1713; background: var(--p-pink); }
.state .icon { font-size: 1.25rem; margin-top: .1rem; }
.pkg { display: flex; align-items: center; gap: .85rem; padding: .95rem 1.1rem; border: 1px solid var(--line-strong); border-radius: 20px; color: var(--ink); background: var(--paper); transition: border-color .2s, background-color .2s, transform .25s var(--ease); }
.pkg:hover { border-color: var(--ink); transform: translateY(-1px); color: var(--ink); }
.pkg.is-on { border-color: var(--ink); background: var(--canvas); box-shadow: 0 0 0 1px var(--ink); }
.pkg-dot { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; font-size: .85rem; color: var(--ink); background: var(--paper); }
.pkg.is-on .pkg-dot { border-color: var(--lmh-blue); background: var(--lmh-blue); color: #fff; }

/* ---- Footer: แผงเทาอ่อนมุมโค้ง (โครงมาตรฐาน: แบรนด์ + คอลัมน์ลิงก์ + แถบลิขสิทธิ์) ------ */
.site-footer { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-lg); margin: clamp(3rem, 7vw, 6rem) clamp(.5rem, 1.5vw, 1.25rem) clamp(.5rem, 1.5vw, 1.25rem); padding: clamp(2.2rem, 5vw, 4rem) 0 1.5rem; color: var(--ink-2); font-size: .94rem; }
.site-footer .foot-about { max-width: 22rem; color: var(--ink-2); margin-bottom: 1rem; }
.site-footer h4 { font-size: .85rem; color: var(--muted); font-weight: 500; margin-bottom: .9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer a:not(.btn) { color: var(--ink); } .site-footer a:not(.btn):hover { color: var(--lmh-red-ink); }
.site-footer .social-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.site-footer .social-list li { margin: 0; }
.site-footer .social { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--paper); border: 1px solid var(--line-strong); font-size: 1.1rem; transition: transform .3s var(--ease), background .2s, color .2s; }
.site-footer .social:hover { background: var(--lmh-blue); color: #fff !important; transform: translateY(-2px); text-decoration: none !important; }
.site-footer .foot-bar { display: flex; flex-direction: column; gap: .35rem; justify-content: space-between; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
@media (min-width: 768px) { .site-footer .foot-bar { flex-direction: row; align-items: center; } }
@media (display-mode: standalone) { .site-footer { display: none; } }

/* ---- แบนเนอร์คุกกี้ ------------------------------------------------------- */
.cookie-banner { position: fixed; left: 1rem; bottom: 1rem; z-index: 1040; width: min(26rem, calc(100vw - 2rem)); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 24px; padding: 1.1rem 1.2rem; box-shadow: 0 18px 50px rgba(20, 24, 31, .16); opacity: 0; transform: translateY(14px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.cookie-banner.is-in { opacity: 1; transform: none; }
@media (max-width: 767.98px) { body.has-tabbar .cookie-banner { bottom: calc(64px + 1.5rem + env(safe-area-inset-bottom)); } .cookie-banner { left: .75rem; right: .75rem; width: auto; } }
@media (prefers-reduced-motion: reduce) { .cookie-banner { transition: none; } }

/* ---- หน้านโยบาย/ข้อกำหนด -------------------------------------------------- */
.legal { font-size: 1rem; line-height: 1.8; color: var(--ink-2); }
.legal h2 { font-size: 1.2rem; letter-spacing: -.01em; margin: 2.2rem 0 .7rem; color: var(--ink); scroll-margin-top: 5rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: .4rem; }
.legal table { font-size: .92rem; }
.legal b { color: var(--ink); font-weight: 600; }
.legal .mono { text-transform: none; letter-spacing: 0; } /* ชื่อคุกกี้ต้องแสดงตัวพิมพ์เล็ก-ใหญ่ตามจริง */

/* ---- หลังบ้าน v3: แถบข้างเข้ม + แถบบนกระจก + เนื้อหาบนพื้นเทาอ่อน ----------------- */
body.is-admin { background: #f4f4f6; }
.adm { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.adm-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none; padding: 1rem .8rem 1.5rem; background: var(--night); color: #fff; display: flex; flex-direction: column; isolation: isolate; }
.adm-side::-webkit-scrollbar { display: none; }
.adm-side::before { content: ""; position: absolute; z-index: -1; width: 220px; height: 220px; left: -90px; top: -90px; border-radius: 50%; background: var(--lmh-red); filter: blur(80px); opacity: .25; pointer-events: none; }
.adm-brand { display: inline-flex; align-items: center; padding: .45rem .8rem; margin: 0 0 1.2rem .2rem; background: #fff; border-radius: 14px; width: fit-content; }
.adm-brand img { height: 30px; width: auto; }
.adm-nav { display: flex; flex-direction: column; gap: 2px; }
.adm-group { margin: 1.1rem 0 .35rem; padding: 0 .9rem; font-size: .72rem; font-weight: 600; letter-spacing: .04em; color: rgba(255, 255, 255, .38); }
.adm-link { position: relative; display: flex; align-items: center; gap: .75rem; padding: .58rem .9rem; border-radius: 12px; color: rgba(255, 255, 255, .72); font-size: .93rem; font-weight: 500; transition: background-color .2s, color .2s; }
.adm-link .icon { font-size: 1.1rem; opacity: .8; }
.adm-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.adm-link.active { background: #fff; color: var(--ink); font-weight: 600; }
.adm-link.active .icon { opacity: 1; color: var(--lmh-red); }
.adm-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 .4rem; border-radius: 999px; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; background: var(--lmh-red); color: #fff; }
.adm-main { min-width: 0; display: flex; flex-direction: column; }
.adm-top { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .7rem clamp(1rem, 2.5vw, 2rem); background: rgba(244, 244, 246, .78); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid rgba(22, 23, 26, .06); }
.adm-search { display: inline-flex; align-items: center; gap: .6rem; width: min(340px, 100%); padding: .5rem .6rem .5rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: .9rem; text-align: left; transition: border-color .2s, box-shadow .2s; }
.adm-search:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.adm-search span { flex: 1; }
.adm-search kbd { padding: .05rem .5rem; border-radius: 6px; background: var(--panel); color: var(--muted); font-size: .75rem; box-shadow: none; }
.adm-icon-btn { width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); transition: box-shadow .2s, border-color .2s; }
.adm-icon-btn:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.adm-user { display: flex; align-items: center; gap: .6rem; padding: .25rem .7rem .25rem .25rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); }
.adm-user .avatar { width: 32px; height: 32px; font-size: .85rem; background: var(--night); color: #fff; }
.adm-user b { display: block; font-size: .88rem; font-weight: 600; } .adm-user small { display: block; font-size: .72rem; color: var(--muted); }
.adm-content { padding: clamp(1rem, 2.5vw, 2rem) clamp(1rem, 2.5vw, 2rem) 3rem; flex: 1; }
.adm-content > .d-flex:first-of-type h1, .adm-content h1.h3 { font-size: clamp(1.45rem, 2.4vw, 1.85rem); font-weight: 700; letter-spacing: -.03em; }
.adm-content .lbl { background: transparent; border: 0; box-shadow: none; padding: 0; color: var(--muted); font-size: .8rem; }
.adm-content .alert { border: 0; border-radius: 16px; box-shadow: var(--shadow-sm); }
.adm-drawer { background: var(--night); color: #fff; width: 280px !important; border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.adm-drawer .adm-icon-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: #fff; }
.adm-drawer .adm-brand { margin: 0; }
.offcanvas-backdrop.show { opacity: .35; }
@media (max-width: 991.98px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { display: none; }
  .adm-search { width: auto; flex: 1; }
}
@media (max-width: 575.98px) { .adm-search kbd { display: none; } }

/* การ์ดเนื้อหา (ใช้ร่วมทุกหน้าในหลังบ้าน) */
.dash-card { background: var(--paper); border: 1px solid rgba(22, 23, 26, .06); border-radius: 20px; padding: 1.4rem; box-shadow: var(--shadow-sm); }
.dash-card.p-0 { overflow: hidden; }
.dash-card h2 { font-size: 1rem; font-weight: 600; }

/* KPI */
.adm-content .stat { height: 100%; transition: transform .35s var(--ease), box-shadow .35s; }
.adm-content .stat .num { font-size: 1.65rem; font-weight: 700; letter-spacing: -.035em; }
.kpi-link { color: inherit; display: block; height: 100%; }
.kpi-link:hover { color: inherit; } .kpi-link:hover .stat { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.row > :first-child > .kpi-link .stat { background: var(--night); border-color: var(--night); color: #fff; }
.row > :first-child > .kpi-link .stat .lbl-s { color: rgba(255,255,255,.65); }
.row > :first-child > .kpi-link .stat .icon-chip { background: rgba(255,255,255,.1); color: #6fd39b; }

/* งานที่ต้องทำ */
.todo { display: flex; align-items: center; gap: .8rem; height: 100%; padding: .9rem 1rem; border-radius: 16px; background: var(--t, var(--panel)); color: var(--ink); font-size: .94rem; line-height: 1.35; transition: transform .3s var(--ease); }
.todo:hover { color: var(--ink); transform: translateY(-2px); }
.todo > div { flex: 1; }
.todo b { font-size: 1.2rem; font-weight: 700; margin-right: .2rem; }
.todo > .icon:last-child { opacity: .5; transition: transform .3s var(--ease), opacity .2s; }
.todo:hover > .icon:last-child { opacity: 1; transform: translateX(3px); }

/* ตาราง */
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--line); --bs-table-hover-bg: var(--canvas); }
.table > :not(caption) > * > * { padding: .85rem 1.1rem; }
.table td { white-space: nowrap; }
.table td.wrap { white-space: normal; min-width: 190px; }
.table thead th { font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--canvas); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table a.fw-medium { color: var(--ink); } .table a.fw-medium:hover { color: var(--lmh-red-ink); }

/* กราฟยอดขาย: แท่งเทาเข้ม วันล่าสุด/ชี้แล้วเป็นแดงโลโก้ */
.spark { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: .5rem; }
.spark span { flex: 1; background: #d9dbe0; border-radius: 8px 8px 3px 3px; min-height: 3px; transition: background-color .2s; transform-origin: bottom; animation: rise .7s var(--ease) both; }
.spark span:last-child { background: var(--lmh-blue); }
.spark span:hover { background: var(--lmh-red); }
@keyframes rise { from { transform: scaleY(0); } }
.badge-soft { --bs-badge-padding-x: .65em; --bs-badge-padding-y: .38em; color: var(--ink); background: var(--panel); border-radius: 999px; font-weight: 500; }

/* ---- หน้าเรียน ----------------------------------------------------------- */
.lesson-head { background: transparent; }
.pl-rate { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); }
.pl-rate .form-select { width: auto; border-radius: 999px; padding-block: .3rem; }
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (min-width: 576px) { .lesson-nav { display: flex; } }
.curr-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .95rem 1.1rem; margin-bottom: .75rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); font-weight: 500; color: var(--ink); }
.curr-toggle[aria-expanded="true"] .icon:last-child { transform: rotate(180deg); }
.curr-toggle .icon:last-child { transition: transform .3s var(--ease); }
.min-w-0 { min-width: 0; }

/* ---- แดชบอร์ดนักเรียน ---------------------------------------------------- */
.dash-hero { background: transparent; }
.side-stack { display: grid; gap: 1rem; position: sticky; top: 92px; }
@media (max-width: 991.98px) { .side-stack { position: static; } }
.streak-card { position: relative; overflow: hidden; isolation: isolate; background: var(--night); color: #fff; border-radius: var(--r-md); padding: 1.4rem; box-shadow: var(--shadow-md); }
.streak-card::before { content: ""; position: absolute; z-index: -1; width: 220px; height: 220px; left: -80px; top: -100px; border-radius: 50%; background: var(--lmh-orange); filter: blur(70px); opacity: .35; }
.streak-card .small { color: rgba(255,255,255,.7); }
.streak-card .icon-chip { background: rgba(255,255,255,.1); color: var(--lmh-orange); }
.streak-n { font-size: 1.75rem; font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.streak-n small { font-size: .9rem; font-weight: 400; letter-spacing: 0; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.wd { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-family: var(--mono); font-size: .68rem; text-transform: uppercase; }
.wd { color: rgba(255,255,255,.6); }
.wd i { width: 100%; max-width: 38px; aspect-ratio: 1; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255,255,255,.1); display: grid; place-items: center; font-style: normal; color: #fff; transition: transform .3s var(--ease); }
.wd.on i { background: var(--lmh-red); border-color: var(--lmh-red); }
.wd.today i { outline: 2px solid #fff; outline-offset: 2px; }
.wd:hover i { transform: translateY(-2px); }
.is-compact .cal-grid { gap: .25rem; }
.is-compact .cal-day { border-radius: 10px; font-size: .8rem; }
.is-compact .cal-day small { display: none; }
.side-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1rem 1.1rem; background: transparent; border: 0; font-weight: 500; color: var(--ink); border-radius: var(--r-md); }
.side-toggle[aria-expanded="true"] .icon:last-child { transform: rotate(180deg); }
.side-toggle .icon:last-child { transition: transform .3s var(--ease); }

/* ---- แชทบอทลอย ---------------------------------------------------------- */
.chat-fab { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 1035; height: 54px; padding: 0 1.25rem 0 1rem; border: 0; border-radius: 999px; background: #fff; color: var(--lmh-blue); outline: 1px solid var(--line-strong); display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; box-shadow: 0 14px 40px rgba(20, 24, 31, .25); transition: transform .3s var(--ease), box-shadow .3s; }
.chat-fab:hover { transform: translateY(-3px); box-shadow: 0 18px 46px rgba(20, 24, 31, .32); }
.chat-fab::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(5, 79, 144, .3); animation: fab-ping 3.2s var(--ease) 1.5s 3; pointer-events: none; }
@keyframes fab-ping { 0% { box-shadow: 0 0 0 0 rgba(5, 79, 144, .3); } 70%, 100% { box-shadow: 0 0 0 16px rgba(5, 79, 144, 0); } }
.chat-fab .icon { color: var(--lmh-red); }
.chat.is-open .chat-fab { display: none; }
@media (max-width: 767.98px) { body.has-tabbar .chat-fab { bottom: calc(64px + 1.5rem + env(safe-area-inset-bottom)); } }
.chat-panel { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 1036; width: min(390px, calc(100vw - 2rem)); height: min(640px, calc(100vh - 2.2rem)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 30px 80px rgba(20, 24, 31, .22); display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right; animation: chat-in .35s var(--ease); }
.chat-panel[hidden] { display: none; }
@keyframes chat-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.chat-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.chat-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; color: var(--ink); transition: background-color .2s; }
.chat-close:hover { background: var(--panel); }
.chat-log { flex: 1; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: .6rem; overscroll-behavior: contain; }
.msg { max-width: 88%; padding: .6rem .9rem; border-radius: 20px; font-size: .92rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; animation: msg-in .3s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg.bot { align-self: flex-start; background: var(--panel); border-bottom-left-radius: 6px; }
.msg.user { align-self: flex-end; background: var(--lmh-blue); color: #fff; border-bottom-right-radius: 6px; }
.msg a { color: inherit; text-decoration: underline; text-underline-offset: .2em; font-weight: 500; }
.msg.typing { display: flex; gap: 5px; align-items: center; padding: .85rem 1rem; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite ease-in-out; }
.msg.typing i:nth-child(2) { animation-delay: .15s; } .msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }
.chat-suggest { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1.1rem .7rem; }
.chat-suggest:empty { display: none; }
.chip-btn { border: 1px solid var(--line-strong); background: var(--paper); border-radius: 999px; padding: .3rem .8rem; font-size: .86rem; color: var(--ink); transition: background-color .2s, border-color .2s; }
.chip-btn:hover { background: var(--panel); border-color: var(--ink); }
.chat-form { display: flex; gap: .5rem; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.chat-form .form-control { border-radius: 999px; padding-inline: 1.1rem; }
.chat-send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: #141414; color: #fff; display: grid; place-items: center; transition: transform .2s var(--ease); }
.chat-send:hover { transform: translateY(-2px); }
.chat-foot { padding: 0 1.1rem .8rem; font-size: .66rem; color: var(--muted); text-transform: none; }
.chat-foot a { color: var(--ink); text-decoration: underline; }
@media (max-width: 575.98px) {
  .chat-fab { right: .9rem; padding: 0; width: 54px; justify-content: center; } .chat-fab-label { display: none; }
  .chat-panel { inset: auto .5rem .5rem .5rem; width: auto; height: min(78vh, 640px); }
}
body.menu-open .chat { display: none; }

/* ---- CRUD หลังบ้าน -------------------------------------------------------- */
.list-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.search-box { flex: 1 1 240px; max-width: 360px; }
.list-toolbar .search-box .input-group-text, .list-toolbar .search-box .form-control { border-radius: 999px; }
.list-toolbar .search-box .input-group-text { border-top-right-radius: 0; border-bottom-right-radius: 0; padding-left: 1rem; }
.list-toolbar .search-box .form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.list-toolbar .search-box:focus-within { border-radius: 999px; }
.list-toolbar .form-select { border-radius: 999px; }
.filter-select { width: auto; max-width: 190px; }
.modal-content { border: 0; border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(20, 24, 31, .25); }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-backdrop.show { opacity: .3; }
.modal.show { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.page-form .btn-close { display: none; }
.sort-link { color: inherit; display: inline-flex; align-items: center; gap: .25rem; }
.sort-link:hover { color: var(--ink); }
.row-actions { display: inline-flex; gap: .35rem; justify-content: flex-end; flex-wrap: nowrap; }
.bulk-bar { position: sticky; bottom: 1rem; z-index: 5; margin-top: 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--night); color: #fff; border-radius: 999px; padding: .55rem .6rem .55rem 1.2rem; box-shadow: 0 18px 40px rgba(20, 24, 31, .3); }
.bulk-bar[hidden] { display: none; }
.bulk-bar .btn-light { --bs-btn-bg: rgba(255,255,255,.12); --bs-btn-color: #fff; --bs-btn-border-color: transparent; --bs-btn-hover-bg: rgba(255,255,255,.22); --bs-btn-hover-color: #fff; }
.trash-row { opacity: .8; }
.kpi-link { color: inherit; display: block; }
.kpi-link:hover { color: inherit; }
@media (max-width: 767.98px) {
  .filter-select { max-width: none; flex: 1 1 140px; }
  .search-box { max-width: none; }
  .table-cards thead { display: none; }
  .table-cards tr { display: block; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
  .table-cards td { display: flex; justify-content: space-between; gap: 1rem; padding: .2rem 0 !important; border: 0 !important; white-space: normal !important; text-align: right; }
  .table-cards td::before { content: attr(data-label); font-family: var(--mono); font-size: .68rem; text-transform: uppercase; color: var(--muted); text-align: left; flex: none; padding-top: .15rem; }
  .table-cards td.row-actions-cell { justify-content: flex-end; }
  .table-cards td.row-actions-cell::before, .table-cards td.no-label::before { display: none; }
}

/* ---- Reveal + motion ----------------------------------------------------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ==========================================================================
   หน้าภายใน v2: หัวหน้า, ตัวกรอง, หน้าคอร์ส, ชำระเงิน
   ========================================================================== */
.page-hero { position: relative; isolation: isolate; padding: clamp(2.2rem, 6vw, 4.2rem) 0 clamp(1.8rem, 4vw, 2.8rem); }
.page-hero::before, .page-hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(80px); pointer-events: none; }
.page-hero::before { width: 40vw; height: 22vw; left: 30vw; top: -12vw; background: #c9ccd3; opacity: .7; }
.page-hero::after { width: 18vw; height: 18vw; left: 4vw; top: 10%; background: var(--lmh-red); opacity: .08; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.15; margin: .9rem 0 .5rem; }
.page-hero h1 .soft { color: var(--faint); font-weight: 600; }
.page-hero .lead-s { color: var(--muted); font-size: 1.05rem; max-width: 36rem; margin: 0; }
.page-hero.is-center { text-align: center; }
.page-hero.is-center .crumbs { justify-content: center; }
.page-hero.is-center .lead-s { margin-inline: auto; }

/* ตัวกรองแบบ segmented กระจก */
.seg { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .3rem; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--shadow-sm); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.seg a { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem 1rem; border-radius: 999px; font-size: .92rem; font-weight: 500; color: var(--ink-2); transition: background-color .2s, color .2s; }
.seg a:hover { background: var(--panel); color: var(--ink); }
.seg a.on { background: var(--lmh-blue); color: #fff; }

/* หน้าคอร์ส */
.hero-cover { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--t, var(--panel)); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.hero-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-cover .big { font-size: 4rem; color: var(--ink); }
.hero-cover .ui-pill { position: absolute; left: 1rem; bottom: 1rem; }
.fact-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.fact-row .tile-n { min-width: 120px; flex: 1 1 0; text-align: left; padding: .85rem 1.1rem; }
.fact-row .tile-n b { font-size: 1.35rem; }
.buy-card { position: sticky; top: 92px; padding: 1.5rem; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.buy-price { font-size: 2.3rem; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; }
.buy-price s { font-size: 1rem; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: .4rem; }
.buy-card .pkg { padding: .7rem .9rem; }
.course-body h2 { font-size: 1.35rem; margin-bottom: 1rem; }
@media (max-width: 991.98px) { .buy-card { position: static; } }

/* ชำระเงิน: สรุปยอดเป็นการ์ดเข้ม */
.sum-card { position: sticky; top: 92px; overflow: hidden; isolation: isolate; padding: 1.6rem; border-radius: var(--r-md); background: var(--night); color: #fff; box-shadow: var(--shadow-lg); }
.sum-card::before { content: ""; position: absolute; z-index: -1; width: 260px; height: 260px; right: -90px; top: -120px; border-radius: 50%; background: var(--lmh-red); filter: blur(80px); opacity: .32; }
.sum-card::after { content: ""; position: absolute; z-index: -1; width: 240px; height: 240px; left: -100px; bottom: -130px; border-radius: 50%; background: var(--lmh-blue); filter: blur(80px); opacity: .35; }
.sum-card .text-secondary, .sum-card .muted-l { color: rgba(255,255,255,.6) !important; }
.sum-card hr { border-color: rgba(255,255,255,.18); opacity: 1; }
.sum-card .sum-total { font-size: 2.2rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.sum-card .checklist li { color: rgba(255,255,255,.8); }
.sum-card .checklist .icon { color: #6fd39b; }
.qr-stage { position: relative; isolation: isolate; border-radius: var(--r-md); background: var(--canvas); padding: 1.5rem 1rem; text-align: center; overflow: hidden; }
.qr-stage::before { content: ""; position: absolute; z-index: -1; width: 70%; height: 70%; left: 15%; top: 15%; border-radius: 50%; background: var(--lmh-blue); filter: blur(60px); opacity: .18; }
.qr-stage .qr-box { box-shadow: var(--shadow-md); border: 0; }
.step-h { display: flex; align-items: center; gap: .65rem; font-size: 1.1rem; margin-bottom: 1rem; }
.step-h .n { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; background: var(--lmh-blue); color: #fff; }
@media (max-width: 767.98px) { .sum-card { position: static; } }

/* หน้าเรียน: แถบหัวคอร์สเป็นกระจก, ปุ่มควบคุมเป็นเม็ดยาขาว */
.lesson-bar { padding: .9rem 1.2rem; border-radius: var(--r-md); }
.lesson-bar h2 { font-size: 1.15rem; }
.player-frame { box-shadow: var(--shadow-lg); }
.player-bar .btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); box-shadow: var(--shadow-sm); }
.lesson-panel { box-shadow: var(--shadow-md); }
@media (max-width: 575.98px) { .fact-row .tile-n { min-width: 0; padding: .75rem .8rem; } .fact-row .tile-n b { font-size: 1.1rem; } }

/* ---- หลังบ้าน: หน้าภาพรวมแบบ bento ------------------------------------------- */
.bento { display: grid; gap: 1rem; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: dense; }
.b-card { position: relative; display: flex; flex-direction: column; gap: .9rem; min-width: 0; padding: 1.35rem; border-radius: 22px; background: var(--paper); border: 1px solid rgba(22, 23, 26, .06); box-shadow: var(--shadow-sm); color: var(--ink); }
a.b-card { transition: transform .35s var(--ease), box-shadow .35s; } a.b-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.b-hero { grid-column: span 8; grid-row: span 2; overflow: hidden; isolation: isolate; background: var(--night); border-color: var(--night); color: #fff; justify-content: space-between; min-height: 300px; }
a.b-hero:hover { color: #fff; }
.b-hero::before { content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; right: -100px; top: -160px; border-radius: 50%; background: var(--lmh-red); filter: blur(90px); opacity: .35; }
.b-hero::after { content: ""; position: absolute; z-index: -1; width: 300px; height: 300px; left: -120px; bottom: -170px; border-radius: 50%; background: var(--lmh-blue); filter: blur(90px); opacity: .4; }
.b-label { font-size: .86rem; color: var(--muted); }
.b-hero .b-label, .b-hero .b-sub { color: rgba(255, 255, 255, .62); }
.b-big { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -.045em; line-height: 1.05; margin: .2rem 0; }
.b-go { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); transition: transform .35s var(--ease); }
a.b-hero:hover .b-go { transform: rotate(45deg); }
.spark.is-dark { height: 130px; }
.spark.is-dark span { background: rgba(255, 255, 255, .18); }
.spark.is-dark span:last-child { background: #fff; }
.spark.is-dark span:hover { background: var(--lmh-red); }
.b-empty { padding: 2rem 0; text-align: center; color: rgba(255, 255, 255, .5); font-size: .9rem; }
.b-empty.is-light { color: var(--muted); }
.b-todo { grid-column: span 4; grid-row: span 2; }
.b-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.b-head h2 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1rem; font-weight: 600; }
.b-head a { color: var(--muted); } .b-head a:hover { color: var(--ink); }
.b-list { display: grid; gap: .4rem; }
.b-row { display: flex; align-items: center; gap: .7rem; padding: .8rem .9rem; border-radius: 14px; background: var(--canvas); color: var(--ink); font-size: .92rem; transition: background-color .2s; }
.b-row:hover { background: var(--panel); color: var(--ink); }
.b-row b { font-size: 1.1rem; font-weight: 700; }
.b-row .icon:last-child { color: var(--faint); }
.b-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.b-dot.is-red { background: var(--lmh-red); box-shadow: 0 0 0 4px rgba(208, 32, 35, .14); }
.b-dot.is-orange { background: var(--lmh-orange); box-shadow: 0 0 0 4px rgba(245, 130, 32, .16); }
.b-dot.is-blue { background: var(--lmh-blue); box-shadow: 0 0 0 4px rgba(5, 79, 144, .14); }
.b-clear { display: flex; align-items: center; gap: .9rem; margin: auto 0; padding: 1rem; border-radius: 16px; background: var(--canvas); }
.b-kpi { grid-column: span 4; gap: .35rem; }
.b-kpi .icon-chip { margin-bottom: .5rem; }
.b-num { font-size: 2rem; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; }
.b-courses { grid-column: span 5; }
.b-bar + .b-bar { padding-top: .8rem; border-top: 1px solid var(--line); }
.b-track { height: 8px; border-radius: 99px; background: var(--panel); overflow: hidden; }
.b-track i { display: block; height: 100%; border-radius: inherit; background: var(--lmh-blue); transform-origin: left; animation: grow-x .9s var(--ease) both; }
.b-bar:first-of-type .b-track i { background: var(--lmh-red); }
@keyframes grow-x { from { transform: scaleX(0); } }
.b-activity { grid-column: span 7; }
.b-timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--line); display: grid; gap: .9rem; }
.b-timeline li { position: relative; font-size: .92rem; }
.b-timeline li::before { content: ""; position: absolute; left: calc(-1.1rem - 6px); top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.b-timeline li:first-child::before { background: var(--lmh-red); border-color: var(--lmh-red); }
@media (max-width: 1199.98px) {
  .b-hero { grid-column: span 12; grid-row: auto; }
  .b-todo { grid-column: span 12; grid-row: auto; }
  .b-courses, .b-activity { grid-column: span 12; }
}
@media (max-width: 767.98px) { .b-kpi { grid-column: span 6; } .b-kpi:last-of-type { grid-column: span 12; } .b-hero { min-height: 260px; } }
.b-shortcuts { margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--line); }
.b-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem; }
.b-grid a { display: flex; align-items: center; gap: .55rem; padding: .6rem .75rem; border-radius: 12px; border: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; font-weight: 500; transition: border-color .2s, background-color .2s; }
.b-grid a:hover { border-color: var(--ink); color: var(--ink); background: var(--canvas); }
.b-grid .icon { color: var(--muted); }

/* ==========================================================================
   หลังบ้าน v4: คิวงานแบบ ryu — การชำระเงินหน้าเดียว, แผงด้านข้าง, หน้าต่างนักเรียน, ลากวางจัดลำดับ
   ========================================================================== */
.pay-tabs { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; margin-bottom: 1rem; padding-bottom: 2px; }
.pay-tabs::-webkit-scrollbar { display: none; }
.pay-tab { flex: none; display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); font-size: .9rem; white-space: nowrap; }
.pay-tab b { min-width: 1.5rem; padding: 0 .4rem; border-radius: 999px; background: var(--panel); color: var(--muted); font-size: .78rem; font-weight: 600; text-align: center; }
.pay-tab:hover { color: var(--ink); border-color: var(--line-strong); }
.pay-tab.active { background: var(--p-blue); border-color: transparent; color: var(--lmh-blue); font-weight: 600; }
.pay-tab.active b { background: var(--lmh-blue); color: #fff; }
.pay-tab.is-alert b { background: var(--lmh-red); color: #fff; }

.slip-thumb { width: 46px; height: 58px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); display: grid; place-items: center; color: var(--faint); flex: none; }
.slip-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
button.slip-thumb { cursor: zoom-in; transition: transform .2s var(--ease), box-shadow .2s; }
button.slip-thumb:hover { transform: scale(1.06); box-shadow: var(--shadow-sm); }
.slip-thumb.is-empty { border-style: dashed; }
@media (max-width: 767.98px) { .pay-table .slip-thumb { width: 40px; height: 50px; } }

.dash-panel { --bs-offcanvas-width: min(480px, 100vw); border-left: 0; box-shadow: var(--shadow-lg); }
.dash-panel-body { height: 100%; display: flex; flex-direction: column; }
.dash-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.25rem .9rem; border-bottom: 1px solid var(--line); }
.dash-panel-scroll { flex: 1; overflow-y: auto; padding: 1.1rem 1.25rem 2rem; }
.pay-slip-img { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); max-width: 320px; }
.pay-slip-img img { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: contain; }

.sm-h { display: flex; align-items: center; gap: .45rem; font-size: .95rem; font-weight: 600; margin: 0 0 .7rem; }
.access-list { display: flex; flex-direction: column; gap: .5rem; }
.access-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem 1rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 16px; background: var(--canvas); transition: background .2s, border-color .2s; }
.access-row.is-on { background: var(--paper); border-color: rgba(5, 79, 144, .3); box-shadow: inset 3px 0 0 var(--lmh-blue); }
.access-row .form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }
.access-row .form-check-input:checked { background-color: var(--lmh-blue); border-color: var(--lmh-blue); }
.access-course { display: flex; flex-direction: column; min-width: 0; cursor: pointer; line-height: 1.35; }
.access-exp { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .35rem; }
.access-exp .form-control { width: 9.5rem; }
.access-quick { display: flex; gap: .25rem; }
.access-quick .btn { --bs-btn-padding-x: .55rem; font-size: .8rem; }
.access-row:not(.is-on) .access-exp { opacity: .55; }
@media (max-width: 767.98px) { .access-row { grid-template-columns: auto 1fr; } .access-exp { grid-column: 1 / -1; justify-content: flex-start; } }

.drag-handle { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 32px; padding: 0; margin-right: .1rem; border: 0; border-radius: 8px; background: transparent; color: var(--faint); cursor: grab; touch-action: none; flex: none; letter-spacing: -.6em; }
.drag-handle .icon { width: .8em; }
.drag-handle:hover, .drag-handle:focus-visible { background: var(--panel); color: var(--lmh-blue); }
.drag-handle.is-demo { display: inline-flex; width: 20px; height: 20px; vertical-align: middle; cursor: default; background: var(--panel); }
body.is-sorting, body.is-sorting * { cursor: grabbing !important; user-select: none; }
[data-sort-item].is-dragging { position: relative; z-index: 2; background: var(--paper); box-shadow: var(--shadow-md); outline: 2px solid var(--lmh-blue); outline-offset: -2px; border-radius: 14px; }
.pay-table .chip { white-space: nowrap; }

/* หน้าเกี่ยวกับเรา (เขียนให้คนและ AI อ้างอิง) */
.fact-list { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .55rem 1.25rem; margin: 0; padding: 1.25rem 1.4rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--canvas); }
.fact-list dt { font-weight: 600; color: var(--lmh-blue); }
.fact-list dd { margin: 0; }
@media (max-width: 575.98px) { .fact-list { grid-template-columns: 1fr; } .fact-list dd { margin-bottom: .4rem; } }
.about h2 { margin: 0 0 .8rem; }
.about-table th { font-size: .85rem; color: var(--muted); font-weight: 500; }
.follow-plain { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.follow-plain a { display: inline-flex; align-items: center; gap: .4rem; }

/* ปกคอร์สแบบโปสเตอร์แนวตั้ง (สัดส่วน A4 ตามภาพปกจริง) — เห็นทั้งภาพ ไม่ถูกตัด */
.course-card .cover.is-poster { aspect-ratio: 1055 / 1491; }
.cover.is-poster img, .hero-cover.is-poster img { object-fit: contain; }
.hero-cover.is-poster { aspect-ratio: 1055 / 1491; max-width: 380px; margin-inline: auto; }
@media (max-width: 991.98px) { .hero-cover.is-poster { max-width: 360px; } }

/* ราคาในการ์ดคอร์ส/โปสเตอร์: ราคาจริงตัวใหญ่สีแดง ราคาเดิมขีดฆ่าตัวเล็ก */
.card-price { display: flex; flex-direction: column; align-items: flex-end; flex: none; line-height: 1.15; }
.card-price b { font-size: 1.2rem; font-weight: 700; color: var(--lmh-red); letter-spacing: -.02em; }
.card-price s { font-size: .8rem; color: var(--muted); }
.cover.is-poster .tag { display: none; }   /* โปสเตอร์มีชื่อคอร์สในภาพอยู่แล้ว */

/* โปสเตอร์หน้าแรก: ชื่อ + ราคาอยู่ใต้ภาพ (ไม่ทับภาพ) */
.poster { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); }
.poster img { border-radius: calc(var(--r-md) - 2px) calc(var(--r-md) - 2px) 0 0; }
.poster-cap { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem 1rem; }
.poster-cap > .min-w-0 { flex: 1; display: flex; flex-direction: column; }
.poster-cap b { font-size: 1.05rem; line-height: 1.3; }
.poster-cap small { color: var(--muted); font-size: .85rem; }
.poster-go-btn { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--lmh-blue); color: #fff; transition: transform .35s var(--ease); }
.poster:hover .poster-go-btn { transform: rotate(45deg); }
@media (max-width: 575.98px) {
  .poster-cap { flex-wrap: wrap; gap: .35rem .5rem; padding: .65rem .7rem .8rem; }
  .poster-cap > .min-w-0 { flex-basis: 100%; }
  .poster-cap b { font-size: .92rem; }
  .poster-cap small { display: none; }
  .poster-cap .card-price { flex-direction: row; align-items: baseline; gap: .35rem; margin-right: auto; }
  .poster-cap .card-price b { font-size: 1.05rem; }
  .poster-go-btn { width: 30px; height: 30px; }
}

/* หน้าคอร์ส: ราคา + ปุ่มสมัครอยู่ส่วนบน เห็นได้ทันทีโดยไม่ต้องเลื่อน */
.course-hero .hero-buy { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.course-hero .buy-price small { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.course-hero .buy-price { color: var(--lmh-red); }
.course-hero .buy-price s { color: var(--muted); }
@media (min-width: 992px) { .course-hero { padding-top: 1rem; } }
@media (max-width: 575.98px) { .course-hero .hero-buy .btn-lg { flex: 1 1 100%; } }
.lesson-line.is-flat { padding: 1rem 1.25rem; }

/* หัวข้อภาษาไทย 2 บรรทัด: สระบน/ล่างไม่ชนกัน */
.display-6 { line-height: 1.32; }
.display-6 .soft { margin-bottom: .1em; }
/* หน้าแรก: ระยะระหว่างแถวภาพ hero กับส่วนคอร์ส */
.hero + .section { padding-top: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 575.98px) { .creds { gap: .35rem; } .creds li { font-size: .8rem; padding: .25rem .65rem; } }

/* หัวข้อที่กดได้ (หน้าแรก: "คอร์สทั้งหมด" → /courses/) */
.title-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .35em; }
.title-link .icon-arrow { width: .6em; height: .6em; color: var(--lmh-red); transition: transform .2s; }
.title-link:hover { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }
.title-link:hover .icon-arrow { transform: translateX(4px); }
