/* ============================================================
   Levels & Waves Academy — Premium Design System v2
   Dual theme (dark/light) built on eye-care research:
   - no pure black/white surfaces (reduces halation & glare)
   - body text contrast ~9–12:1 dark / ~10:1 light (AA+, not harsh)
   - warm light theme (less blue light), cool-calm dark theme
   - 1.75 line-height, ~68ch reading measure, adjustable type scale
   ============================================================ */

/* ---------- self-hosted fonts ---------- */
@font-face { font-family: 'Noto Sans Thai'; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/noto-sans-thai-thai-400-normal.woff2') format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 600; font-display: swap;
  src: url('/assets/fonts/noto-sans-thai-thai-600-normal.woff2') format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 700; font-display: swap;
  src: url('/assets/fonts/noto-sans-thai-thai-700-normal.woff2') format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 800; font-display: swap;
  src: url('/assets/fonts/noto-sans-thai-thai-800-normal.woff2') format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/noto-sans-thai-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D, U+2026; }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 600; font-display: swap;
  src: url('/assets/fonts/noto-sans-thai-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D, U+2026; }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 700; font-display: swap;
  src: url('/assets/fonts/noto-sans-thai-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D, U+2026; }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 800; font-display: swap;
  src: url('/assets/fonts/noto-sans-thai-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D, U+2026; }

/* ---------- design tokens ---------- */
:root {
  --font: 'Noto Sans Thai', 'Sukhumvit Set', 'Leelawadee UI', Tahoma, 'Segoe UI', sans-serif;
  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --speed: .22s;
  --shadow-1: 0 1px 2px rgba(2, 6, 16, .18);
  --maxw: 1180px;
  --fs-base: 16.5px;
}
html[data-fs="1"] { --fs-base: 15px; }
html[data-fs="2"] { --fs-base: 16.5px; }
html[data-fs="3"] { --fs-base: 18.5px; }

/* ----- DARK (default): calm deep-ocean, low-glare ----- */
:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1220;            /* base canvas — never pure black */
  --bg-soft: #0E1628;       /* raised section  */
  --card: #121C31;          /* surfaces        */
  --card-2: #16223C;        /* nested surface  */
  --line: #22304F;
  --line-soft: #1B2740;
  --tx: #E4EAF6;            /* headings — soft white, no #FFF glare */
  --tx-2: #C3CDE2;          /* body            */
  --mut: #A0AECB;           /* secondary       */
  --accent: #E8B94F;        /* brand gold      */
  --accent-2: #F5D78A;
  --accent-ink: #201604;
  --teal: #3ED6C0; --ok: #57D98B; --warn: #F5C04A; --red: #F58A8A;
  --glow: rgba(232, 185, 79, .14);
  --hero-a: rgba(46, 74, 138, .55); --hero-b: rgba(232, 185, 79, .12);
  --glass: rgba(11, 18, 32, .82);
  --shadow-2: 0 10px 34px rgba(2, 6, 16, .45);
  --cover-t1a: #0E3A34; --cover-t1b: #14544A; --cover-t1x: #8FEADC;
  --cover-t2a: #3A2E0F; --cover-t2b: #55461A; --cover-t2x: #F3D992;
  --cover-t3a: #3A1518; --cover-t3b: #542028; --cover-t3x: #F5A8AC;
}
/* ----- LIGHT: warm paper, reduced blue emission ----- */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #F6F3EC;            /* warm paper — never pure white */
  --bg-soft: #EFEBE1;
  --card: #FDFBF6;
  --card-2: #F4F0E7;
  --line: #DCD5C6;
  --line-soft: #E7E1D4;
  --tx: #26303F;            /* soft ink — not #000 */
  --tx-2: #45526A;
  --mut: #545F76;
  --accent: #9A6C10;        /* deepened gold for AA on paper */
  --accent-2: #7C560C;
  --accent-ink: #FFF9EA;
  --teal: #0F8D7C; --ok: #1E8F52; --warn: #9A6E0E; --red: #C24A4A;
  --glow: rgba(176, 126, 26, .12);
  --hero-a: rgba(211, 199, 166, .5); --hero-b: rgba(176, 126, 26, .10);
  --glass: rgba(250, 247, 240, .86);
  --shadow-2: 0 10px 30px rgba(84, 70, 40, .14);
  --cover-t1a: #CFEDE6; --cover-t1b: #A8DCD1; --cover-t1x: #0B5A4E;
  --cover-t2a: #F2E4BD; --cover-t2b: #E7D194; --cover-t2x: #6B4E0A;
  --cover-t3a: #F5D8D8; --cover-t3b: #EBBABC; --cover-t3x: #7C2A30;
}

/* ---------- base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--tx-2);
  font-family: var(--font); font-size: var(--fs-base);
  line-height: 1.75; letter-spacing: .1px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background var(--speed), color var(--speed);
}
h1, h2, h3, h4, b, strong { color: var(--tx); }
h1, h2, h3 { line-height: 1.35; letter-spacing: -.2px; }
p { max-width: 68ch; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, video { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--mut); }
.sm-text { font-size: .9em; }
.center { text-align: center; }
.gold { color: var(--accent); }
.ok-text { color: var(--ok); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: var(--glass); backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line-soft);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; min-height: 66px; gap: 14px; }
.brand { font-weight: 800; font-size: 1.12em; letter-spacing: .2px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-lw { color: var(--tx); }
.brand-ac { background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links > a { color: var(--mut); font-weight: 600; font-size: .93em; position: relative; padding: 4px 0; }
.nav-links > a:hover { color: var(--tx); text-decoration: none; }
.nav-links > a.on { color: var(--tx); }
.nav-links > a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2.5px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.nav-links > a.btn { color: var(--accent-ink); }
.nav-links > a.btn:hover { color: var(--accent-ink); }
.inline-form { display: inline; }

/* prefs cluster (theme + font size) */
.prefs { display: flex; align-items: center; gap: 8px; }
.pref-btn {
  background: var(--card); border: 1px solid var(--line); color: var(--tx-2);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color var(--speed), transform var(--speed);
  font-family: var(--font);
}
.pref-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.fs-group { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--card); }
.fs-group button {
  background: transparent; border: 0; color: var(--mut); cursor: pointer;
  padding: 7px 11px; font-family: var(--font); font-weight: 700; line-height: 1;
}
.fs-group button.on { background: var(--accent); color: var(--accent-ink); }
.fs-group button:nth-child(1) { font-size: 12px; }
.fs-group button:nth-child(2) { font-size: 14.5px; }
.fs-group button:nth-child(3) { font-size: 17px; }

/* hamburger */
.nav-burger { display: none; background: transparent; border: 0; cursor: pointer; padding: 8px; }
.nav-burger span { display: block; width: 22px; height: 2.5px; border-radius: 3px; background: var(--tx); margin: 4.5px 0; transition: transform var(--speed), opacity var(--speed); }

/* ---------- buttons ---------- */
.btn, .btn-ghost {
  display: inline-block; border-radius: 12px; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; font-size: .95em; padding: 11px 22px;
  font-family: var(--font); transition: transform var(--speed), box-shadow var(--speed), border-color var(--speed), filter var(--speed);
}
.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); box-shadow: 0 4px 18px var(--glow);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 26px var(--glow); text-decoration: none; filter: brightness(1.04); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--tx); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn-ghost.danger { color: var(--red); }
.btn-ghost.danger:hover { border-color: var(--red); }
.btn.lg, .btn-ghost.lg { padding: 14px 30px; font-size: 1.05em; border-radius: 14px; }
.btn.sm, .btn-ghost.sm { padding: 6px 14px; font-size: .84em; border-radius: 9px; }
.btn.block { display: block; width: 100%; text-align: center; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  padding: 96px 0 72px;
  background:
    radial-gradient(900px 480px at 82% -12%, var(--hero-a) 0%, transparent 62%),
    radial-gradient(700px 420px at -8% 110%, var(--hero-b) 0%, transparent 60%),
    var(--bg-soft);
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px; opacity: .35;
  -webkit-mask-image: radial-gradient(720px 420px at 70% 20%, #000 0%, transparent 75%);
  mask-image: radial-gradient(720px 420px at 70% 20%, #000 0%, transparent 75%);
}
.hero .wrap { position: relative; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); font-weight: 700; font-size: .85em; letter-spacing: 1px;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 99px; padding: 6px 16px; margin-bottom: 22px;
}
.hero-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.hero h1 { font-size: clamp(30px, 5.4vw, 54px); font-weight: 800; line-height: 1.22; }
.hero-sub { color: var(--mut); font-size: clamp(1em, 2.1vw, 1.16em); margin: 20px 0 32px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-points { display: flex; gap: 8px 26px; flex-wrap: wrap; margin-top: 34px; color: var(--mut); font-size: .9em; font-weight: 600; }

/* ---------- sections & cards ---------- */
.section { padding: 56px 0; }
.section-h { font-size: 1.65em; margin-bottom: 8px; }
.section-h + .grid3, .section-h + .grid4 { margin-top: 24px; }
.page-h { font-size: 1.9em; margin-bottom: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow-1);
  transition: transform var(--speed), box-shadow var(--speed), border-color var(--speed);
}
.card.pad { padding: 26px; }
.pad-s { padding: 16px 18px; }
.card h2 { font-size: 1.2em; margin-bottom: 12px; }
.card h3 { font-size: 1.05em; margin-bottom: 6px; }
.desc-line { margin-bottom: 9px; }
a.card { color: var(--tx-2); display: block; }
a.card:hover, .course-card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line); }

/* course cards */
.card-cover {
  position: relative; height: 158px; display: flex; align-items: center; justify-content: center;
  padding: 20px; text-align: center; font-weight: 800; font-size: 1.12em; line-height: 1.45;
  overflow: hidden;
}
.card-cover::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 18% 25%, rgba(255,255,255,.14) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 70%, rgba(255,255,255,.10) 0 2px, transparent 3px),
    radial-gradient(circle at 60% 20%, rgba(255,255,255,.08) 0 1.5px, transparent 2.5px);
}
.card-cover span { position: relative; z-index: 1; }
.theme-teal .card-cover { background: linear-gradient(135deg, var(--cover-t1a), var(--cover-t1b)); color: var(--cover-t1x); }
.theme-gold .card-cover { background: linear-gradient(135deg, var(--cover-t2a), var(--cover-t2b)); color: var(--cover-t2x); }
.theme-red .card-cover  { background: linear-gradient(135deg, var(--cover-t3a), var(--cover-t3b)); color: var(--cover-t3x); }
.card-body { padding: 20px; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: .84em; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.price { color: var(--accent); font-weight: 800; font-size: 1.12em; }
.price-big { color: var(--accent); font-weight: 800; font-size: 1.8em; margin-bottom: 8px; line-height: 1.3; }
.link-ish { color: var(--accent); font-weight: 700; font-size: .88em; }
.tag {
  display: inline-block; background: var(--card-2); border: 1px solid var(--line);
  color: var(--mut); border-radius: 99px; padding: 2.5px 12px; font-size: .78em; font-weight: 700;
}
.tag.ok   { color: var(--ok); }
.tag.warn { color: var(--warn); }
.tag.free { color: var(--teal); }

/* ---------- course page ---------- */
.course-hero {
  border-bottom: 1px solid var(--line-soft); padding: 48px 0 38px;
  background: radial-gradient(720px 340px at 85% -20%, var(--hero-a) 0%, transparent 60%), var(--bg-soft);
}
.course-hero h1 { font-size: clamp(24px, 4vw, 40px); margin: 10px 0 12px; }
.course-hero-meta { display: flex; gap: 10px 20px; align-items: center; color: var(--mut); font-size: .9em; margin-top: 16px; flex-wrap: wrap; }
.crumbs { color: var(--mut); font-size: .84em; margin-bottom: 6px; }
.course-layout { display: grid; grid-template-columns: 1fr 348px; gap: 26px; align-items: start; }
.course-main { display: flex; flex-direction: column; gap: 22px; }
.sticky { position: sticky; top: 86px; }
.side-points { list-style: none; margin-top: 18px; color: var(--mut); font-size: .9em; }
.side-points li { margin-bottom: 7px; }

/* lesson list */
.lesson-list { list-style: none; }
.lesson-row { display: flex; gap: 13px; padding: 14px 8px; border-top: 1px solid var(--line-soft); transition: background var(--speed); }
.lesson-list.compact .lesson-row { padding: 11px 14px; }
.lesson-row:first-child { border-top: 0; }
.lesson-row:hover { background: var(--card-2); }
.lesson-row.locked { opacity: .52; }
.lesson-row.now { background: var(--card-2); border-left: 3px solid var(--accent); }
.lesson-ico { flex: 0 0 26px; text-align: center; }
.lesson-t { font-weight: 700; font-size: .95em; color: var(--tx); }
.lesson-t a { color: var(--tx); }
.pbar { height: 8px; background: var(--card-2); border: 1px solid var(--line-soft); border-radius: 99px; overflow: hidden; margin: 10px 0 7px; }
.pbar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .5s ease; }

/* ---------- learn / player ---------- */
.learn-layout { display: grid; grid-template-columns: 1fr 330px; gap: 26px; align-items: start; }
.learn-h { font-size: 1.5em; margin: 6px 0 16px; }
.player-col { min-width: 0; }
.player-shell {
  position: relative; background: #05070D; border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 20px; border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  user-select: none; -webkit-user-select: none;
}
.player-shell video { display: block; width: 100%; aspect-ratio: 16/9; background: #05070D; }
.wm {
  position: absolute; pointer-events: none; z-index: 5;
  color: rgba(255,255,255,.5); font-size: 12.5px; font-weight: 600;
  text-shadow: 0 0 6px rgba(0,0,0,.9); white-space: nowrap;
  top: 8%; left: 8%; transition: top 1.2s ease, left 1.2s ease;
}
.wm-corner {
  position: absolute; pointer-events: none; z-index: 5; right: 10px; bottom: 44px;
  color: rgba(255,255,255,.34); font-size: 10.5px; font-weight: 600;
  text-shadow: 0 0 5px rgba(0,0,0,.9); white-space: nowrap;
}
.player-msg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 7, 13, .88); color: #9FB0CE; font-weight: 600; z-index: 4;
  padding: 22px; text-align: center;
}
.player-msg.hide { display: none; }
.lesson-col .card { position: sticky; top: 86px; max-height: calc(100vh - 106px); overflow-y: auto; }

/* ---------- forms ---------- */
.narrow { max-width: 580px; }
.form { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }
.form label { font-weight: 600; font-size: .92em; display: flex; flex-direction: column; gap: 7px; color: var(--tx); }
.form input {
  background: var(--card-2); color: var(--tx); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 14px; font-size: 1em; font-family: var(--font);
  transition: border-color var(--speed), box-shadow var(--speed);
}
.form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.alert { background: color-mix(in srgb, var(--red) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--red) 40%, var(--line)); color: var(--red); border-radius: 11px; padding: 12px 16px; margin: 12px 0; font-size: .92em; }
.alert.info { background: color-mix(in srgb, var(--ok) 10%, var(--card)); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); color: var(--ok); }

/* ---------- checkout / account ---------- */
.co-box { border: 1px solid var(--line-soft); border-radius: 12px; margin: 16px 0; overflow: hidden; }
.co-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line-soft); align-items: center; flex-wrap: wrap; }
.co-box .co-row:first-child, .card .co-row:first-of-type { border-top: 0; }
.ref { font-family: ui-monospace, 'Cascadia Mono', monospace; letter-spacing: 1.5px; color: var(--accent); }
.co-actions { display: flex; justify-content: space-between; margin-top: 18px; flex-wrap: wrap; gap: 10px; }
.dev-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.dev-row:first-of-type { border-top: 0; }
.warn-card { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); margin-bottom: 24px; }
.pend-row { display: flex; justify-content: space-between; gap: 12px; padding-top: 9px; flex-wrap: wrap; }
.disclaimer { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.disclaimer p { margin: 6px auto 0; }

/* ---------- admin ---------- */
.stat .stat-n { font-size: 1.9em; font-weight: 800; color: var(--accent); line-height: 1.3; }
.admin-links { display: flex; gap: 12px; margin: 22px 0; flex-wrap: wrap; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92em; }
.tbl th { text-align: left; color: var(--mut); font-size: .82em; letter-spacing: .4px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--speed); }
.tbl tbody tr:hover { background: var(--card-2); }
.td-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line-soft); background: var(--bg-soft); padding: 46px 0 26px; margin-top: 48px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 30px; }
.foot b { display: block; margin-bottom: 9px; }
.foot a { display: block; color: var(--mut); font-size: .92em; margin-bottom: 6px; }
.foot a:hover { color: var(--tx); }
.foot-bottom { color: var(--mut); font-size: .8em; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-soft); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .course-layout { grid-template-columns: 1fr 300px; }
}
@media (max-width: 900px) {
  .grid3 { grid-template-columns: repeat(2, 1fr); }
  .course-layout, .learn-layout { grid-template-columns: 1fr; }
  .sticky, .lesson-col .card { position: static; max-height: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 64px 0 52px; }

  /* collapsible nav */
  .nav-burger { display: block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-2);
    flex-direction: column; align-items: stretch; padding: 14px 22px 20px; gap: 4px;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links > a { padding: 11px 4px; font-size: 1em; border-bottom: 1px solid var(--line-soft); }
  .nav-links > a.on::after { display: none; }
  .nav-links .inline-form { padding-top: 10px; }
  .nav.open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .nav-burger span:nth-child(2) { opacity: 0; }
  .nav.open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
@media (max-width: 600px) {
  .grid3, .grid4 { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
  .nav-in { gap: 8px; min-height: 58px; }
  .brand { font-size: .96em; }
  .prefs { gap: 5px; }
  .pref-btn { width: 33px; height: 33px; font-size: 14px; }
  .fs-group button { padding: 5px 8px; }
  .fs-group button:nth-child(1) { font-size: 11px; }
  .fs-group button:nth-child(2) { font-size: 13px; }
  .fs-group button:nth-child(3) { font-size: 15px; }
  .nav-burger { padding: 6px 2px 6px 4px; }
  .section { padding: 40px 0; }
  .card.pad { padding: 20px; }
  .hero-cta .btn, .hero-cta .btn-ghost { width: 100%; text-align: center; }
  .co-actions { flex-direction: column; }
  .co-actions .btn-ghost, .co-actions form, .co-actions button { width: 100%; text-align: center; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------- print: never expose the player ---------- */
@media print {
  .player-shell, video { display: none !important; }
  body::after { content: 'เนื้อหานี้มีลิขสิทธิ์ — Levels & Waves Academy'; }
}
