/* englishbetter30days — design system
   Calm reading surface (warm paper, deep green ink) + one high-contrast action color (coral) for every primary CTA,
   + bright feedback colors only inside practice. Mobile-first, 8px rhythm, 44px+ touch targets, reduced-motion aware. */
:root {
  --paper: #fbf8f3;
  --paper-2: #f3eee5;
  --card: #ffffff;
  --ink: #17252a;
  --ink-2: #44525a;
  --muted: #7a8689;
  --line: #e6e0d4;
  --brand: #1f4a3f;
  --brand-2: #2e6b5a;
  --brand-soft: #e5efe9;
  --cta: #e4572e;
  --cta-hover: #cf4720;
  --cta-ink: #ffffff;
  --gold: #b8892f;
  --gold-soft: #fbf1dc;
  --ok: #1f9d63;
  --ok-soft: #e3f6ec;
  --bad: #d64545;
  --bad-soft: #fdecec;
  --flame: #ff7a2f;
  --xp: #6b5bd6;
  --focus: #f0a43a;
  --shadow-sm: 0 1px 2px rgba(23, 37, 42, .06);
  --shadow: 0 1px 2px rgba(23, 37, 42, .05), 0 10px 30px rgba(23, 37, 42, .07);
  --shadow-lg: 0 24px 60px rgba(23, 37, 42, .16);
  --radius: 18px;
  --radius-sm: 12px;
  --serif: "Noto Serif Thai", "Noto Serif", Georgia, serif;
  --sans: "IBM Plex Sans Thai", "Noto Sans Thai", -apple-system, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111819; --paper-2: #182122; --card: #1b2526; --ink: #eef0ec; --ink-2: #c4cbc8; --muted: #8d9895;
    --line: #2a3536; --brand: #9fd3bf; --brand-2: #7cc1a8; --brand-soft: #1d3330; --cta: #ff6b3d; --cta-hover: #ff8257;
    --gold: #e0b866; --gold-soft: #2e2716; --ok: #4fd18f; --ok-soft: #173326; --bad: #ff7b7b; --bad-soft: #3a1e1e;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111819; --paper-2: #182122; --card: #1b2526; --ink: #eef0ec; --ink-2: #c4cbc8; --muted: #8d9895;
  --line: #2a3536; --brand: #9fd3bf; --brand-2: #7cc1a8; --brand-soft: #1d3330; --cta: #ff6b3d; --cta-hover: #ff8257;
  --gold: #e0b866; --gold-soft: #2e2716; --ok: #4fd18f; --ok-soft: #173326; --bad: #ff7b7b; --bad-soft: #3a1e1e;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.72; overflow-x: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
img, svg { max-width: 100%; }
a { color: var(--brand-2); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.3; text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- promo bar + top bar ---------- */
.promo { background: var(--brand); color: #f6efe0; font-size: 14px; text-align: center; padding: 8px 12px; line-height: 1.4; }
:root[data-theme="dark"] .promo { color: #10201a; }
.promo a { color: inherit; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.promo b { color: #ffd38a; }
.promo .cd-inline { font-variant-numeric: tabular-nums; font-weight: 700; background: rgba(255,255,255,.14); padding: 1px 8px; border-radius: 999px; }
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar .inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; color: var(--ink); text-decoration: none; font-size: 16px; min-width: 0; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #e9cf8f; display: grid; place-items: center; font-size: 14px; font-family: Georgia, serif; flex: none; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a, .nav button { font: inherit; font-size: 14px; color: var(--ink-2); text-decoration: none; background: none; border: 0; padding: 8px 10px; border-radius: 10px; cursor: pointer; white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover, .nav button:hover { background: var(--paper-2); }
.nav .hide-sm { display: none; }
.nav [data-stats] { gap: 6px; padding: 0; }
@media (max-width: 420px) { .has-stats .brand span:not(.logo) { display: none; } }
.nowrap { white-space: nowrap; }
@media (min-width: 640px) { .nav .hide-sm { display: inline-flex; } }
.chip-stat { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink); font-variant-numeric: tabular-nums; }
.chip-stat.flame { color: var(--flame); }
.chip-stat.xp { color: var(--xp); }
.chip-stat.cold { color: var(--muted); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; border: 2px solid transparent; transition: transform .12s var(--ease), background .2s, box-shadow .2s; user-select: none; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn-cta { background: var(--cta); color: var(--cta-ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--cta) 70%, #000), 0 10px 24px color-mix(in srgb, var(--cta) 30%, transparent); }
.btn-cta:hover { background: var(--cta-hover); }
.btn-cta:active { box-shadow: 0 2px 0 color-mix(in srgb, var(--cta) 70%, #000); transform: translateY(2px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--brand) 65%, #000); }
:root[data-theme="dark"] .btn-primary { color: #0f1d18; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0f1d18; } }
.btn-primary:active { box-shadow: 0 2px 0 color-mix(in srgb, var(--brand) 65%, #000); transform: translateY(2px); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: 0 3px 0 var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-ok { background: var(--ok); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--ok) 65%, #000); }
.btn-small { min-height: 42px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-google { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: 0 3px 0 var(--line); font-weight: 600; }
.btn-google svg { width: 20px; height: 20px; }
.price-strike { text-decoration: line-through; opacity: .65; font-weight: 500; }

/* ---------- landing ---------- */
.hero { padding: 28px 0 8px; display: grid; gap: 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .06em; color: var(--brand-2); font-weight: 700; background: var(--brand-soft); padding: 5px 12px; border-radius: 999px; }
.hero h1 { font-family: var(--serif); font-size: clamp(36px, 9.5vw, 64px); line-height: 1.18; margin: 14px 0 0; letter-spacing: -.01em; }
.hero .lead { font-size: clamp(20px, 5vw, 24px); margin: 14px 0 6px; font-weight: 600; }
.hero .sub { color: var(--ink-2); margin: 0 0 22px; font-size: 18px; }
.cta { display: grid; gap: 12px; max-width: 440px; }
.cta .note { font-size: 14px; color: var(--muted); text-align: center; margin: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 20px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.facts li { display: inline-flex; align-items: center; gap: 6px; }
.facts b { color: var(--ink); font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.1fr .9fr; align-items: center; padding: 64px 0 40px; }
  .cta { grid-template-columns: 1fr 1fr; max-width: 560px; }
  .cta .note { grid-column: 1 / -1; text-align: left; }
}

/* phone mockup in hero */
.showcase { position: relative; justify-self: center; width: min(340px, 92vw); padding: 10px 0 24px; }
.phone { position: relative; z-index: 2; margin-left: auto; width: 78%; aspect-ratio: 9 / 18.5; background: var(--card); border-radius: 36px; border: 8px solid #1a2326; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; }
.phone .ph-top { padding: 14px 14px 8px; border-bottom: 1px solid var(--line); }
.phone .ph-bar { height: 6px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.phone .ph-bar i { display: block; height: 100%; width: 42%; background: var(--ok); border-radius: 6px; }
.phone .ph-body { padding: 12px; display: grid; gap: 8px; font-size: 12px; line-height: 1.45; }
.phone .bub { padding: 8px 10px; border-radius: 12px; background: var(--paper-2); max-width: 88%; }
.phone .bub.you { justify-self: end; background: var(--brand-soft); }
.phone .bub small { display: block; color: var(--muted); font-size: 10px; }
.phone .opt { border: 2px solid var(--line); border-radius: 10px; padding: 7px 9px; background: var(--card); }
.phone .opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.phone .ph-fb { margin-top: auto; background: var(--ok-soft); color: var(--ok); font-weight: 700; padding: 10px 12px; font-size: 12px; }
.cover { position: absolute; z-index: 1; left: 0; top: 18%; width: 50%; aspect-ratio: 2 / 3; border-radius: 6px 14px 14px 6px; background: linear-gradient(160deg, #2e6b5a 0%, #1f4a3f 55%, #163a31 100%); color: #f5efe2; padding: 16px 14px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: inset 5px 0 0 rgba(0,0,0,.2), 0 18px 40px rgba(20,40,35,.3); transform: rotate(-6deg); overflow: hidden; }
.cover .k { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; opacity: .8; }
.cover .n { font-family: Georgia, serif; font-size: 44px; line-height: 1; color: #e9cf8f; }
.cover .t { font-family: var(--serif); font-size: 16px; line-height: 1.3; font-weight: 600; }
.cover .e { font-size: 9px; opacity: .85; font-style: italic; margin-top: 4px; }
.xp-pop { position: absolute; z-index: 3; right: -6px; top: 34%; background: var(--card); border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow-lg); font-weight: 800; color: var(--xp); font-size: 14px; animation: float 3.2s ease-in-out infinite; }
.streak-pop { position: absolute; z-index: 3; left: 4%; bottom: 4%; background: var(--card); border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow-lg); font-weight: 800; color: var(--flame); font-size: 14px; animation: float 3.6s ease-in-out .4s infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }

.section { padding: 56px 0; }
.section.alt { background: var(--paper-2); }
.section h2 { font-family: var(--serif); font-size: clamp(26px, 6.5vw, 38px); margin: 0 0 10px; }
.section .intro { color: var(--ink-2); margin: 0 0 26px; font-size: 18px; max-width: 640px; }
.kicker { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cta); margin-bottom: 8px; }

.pains { display: grid; gap: 12px; }
@media (min-width: 760px) { .pains { grid-template-columns: 1fr 1fr; } }
.pain { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 56px; position: relative; box-shadow: var(--shadow-sm); }
.pain::before { content: attr(data-emoji); position: absolute; left: 16px; top: 16px; font-size: 24px; }
.pain p { margin: 0; }
.turn { margin: 28px 0 0; padding: 22px; border-radius: var(--radius); background: var(--brand); color: #f4efe3; font-size: 18px; }
:root[data-theme="dark"] .turn { color: #0f1d18; }
.turn b { color: #ffd38a; }
:root[data-theme="dark"] .turn b { color: #4a2c00; }
.source { font-size: 13px; color: var(--muted); margin-top: 10px; }

.demo { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.demo-line { display: flex; gap: 10px; align-items: center; background: var(--paper-2); border-radius: 14px; padding: 12px 14px; margin: 10px 0 4px; }
.demo-line .en { font-size: 18px; font-weight: 600; flex: 1; }

.steps { display: grid; gap: 14px; counter-reset: s; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.step-card .num { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); font-weight: 800; display: grid; place-items: center; margin-bottom: 10px; }
.step-card h3 { margin: 0 0 4px; font-size: 18px; }
.step-card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.step-card .time { font-size: 13px; color: var(--gold); font-weight: 700; }
.motivate { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.motivate div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; font-size: 13px; color: var(--ink-2); }
.motivate b { display: block; font-size: 20px; color: var(--ink); }

.weeks { display: grid; gap: 12px; }
@media (min-width: 760px) { .weeks { grid-template-columns: 1fr 1fr; } }
.week-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; }
.week-card .wk { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--gold); text-transform: uppercase; }
.week-card h3 { margin: 4px 0 6px; font-size: 19px; }
.week-card p { margin: 0; color: var(--ink-2); font-size: 15px; }

.compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.compare th, .compare td { padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--line); vertical-align: middle; }
.compare th:first-child, .compare td:first-child { text-align: left; color: var(--ink-2); }
.compare thead th { font-size: 13px; background: var(--paper-2); }
.compare .us { background: var(--brand-soft); font-weight: 700; }
.compare tr:last-child td { border-bottom: 0; }
.compare .y { color: var(--ok); font-weight: 800; }
.compare .n { color: var(--muted); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
.scroll-x .compare { min-width: 560px; }

.toc-acc details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.toc-acc summary { cursor: pointer; list-style: none; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.toc-acc summary::-webkit-details-marker { display: none; }
.toc-acc summary small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.toc-acc summary::after { content: "⌄"; color: var(--muted); font-size: 20px; transition: transform .2s; }
.toc-acc details[open] summary::after { transform: rotate(180deg); }
.toc { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.toc li + li { border-top: 1px solid var(--line); }
.toc a { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; padding: 12px 18px; color: var(--ink); text-decoration: none; min-height: 54px; }
.toc a:hover { background: var(--paper-2); }
.toc .num { font-family: Georgia, serif; color: var(--muted); font-size: 15px; }
.toc .title { line-height: 1.4; }
.toc .state { font-size: 13px; color: var(--muted); white-space: nowrap; }
.toc .state.free { color: var(--cta); font-weight: 700; }
.toc .state.done { color: var(--ok); font-weight: 700; }

.pricing { max-width: 520px; margin: 0 auto; background: var(--card); border: 2px solid var(--brand-2); border-radius: 26px; padding: 26px 22px; box-shadow: var(--shadow-lg); position: relative; }
.badge { display: inline-block; background: var(--cta); color: #fff; font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 999px; }
.price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 12px 0 2px; }
.price-big { font-family: Georgia, serif; font-size: 56px; line-height: 1; font-weight: 700; color: var(--ink); }
.price-old { font-size: 22px; color: var(--muted); text-decoration: line-through; }
.price-save { font-size: 14px; color: var(--cta); font-weight: 800; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.countdown div { background: var(--paper-2); border-radius: 12px; padding: 8px 4px; text-align: center; }
.countdown b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.countdown span { font-size: 12px; color: var(--muted); }
.cd-label { font-size: 14px; font-weight: 700; color: var(--cta); text-align: center; margin-top: 10px; }
.checklist { list-style: none; padding: 0; margin: 14px 0; }
.checklist li { padding: 7px 0 7px 32px; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 2px; top: 7px; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: 13px; display: grid; place-items: center; line-height: 1; }
.pay-methods { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 12px; }
.pay-methods span { border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; }
.fineprint { font-size: 13px; color: var(--muted); text-align: center; margin: 12px 0 0; }

.promise { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.promise p { margin: 0 0 10px; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); margin: 8px 0 0; }
.final { text-align: center; padding: 64px 0 120px; }
.final h2 { font-family: var(--serif); font-size: clamp(28px, 7vw, 42px); margin: 0 0 8px; }
footer { border-top: 1px solid var(--line); padding: 28px 0 110px; color: var(--muted); font-size: 14px; }
footer a { color: var(--ink-2); }

.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; transform: translateY(110%); transition: transform .35s var(--ease); }
.sticky-cta.show { transform: none; }
.sticky-cta .sc-price { line-height: 1.25; font-size: 13px; color: var(--muted); flex: 1; min-width: 0; }
.sticky-cta .sc-price b { color: var(--ink); font-size: 18px; }
.sticky-cta .btn { min-height: 46px; padding: 0 18px; }
@media (min-width: 900px) { .sticky-cta { left: auto; right: 24px; bottom: 24px; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); width: 420px; } }

/* ---------- learn (path) ---------- */
.dash { padding: 22px 0 8px; }
.dash h1 { font-family: var(--serif); font-size: clamp(26px, 7vw, 34px); margin: 0 0 4px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.flame b { color: var(--flame); }
.stat.xp b { color: var(--xp); }
.continue { display: flex; align-items: center; gap: 14px; background: var(--brand); color: #f4efe3; border-radius: 22px; padding: 18px; text-decoration: none; box-shadow: 0 6px 0 color-mix(in srgb, var(--brand) 60%, #000); margin: 8px 0 20px; }
:root[data-theme="dark"] .continue { color: #0f1d18; }
.continue:active { transform: translateY(3px); box-shadow: 0 3px 0 color-mix(in srgb, var(--brand) 60%, #000); }
.continue .ring { flex: none; }
.continue .c-text { flex: 1; min-width: 0; }
.continue small { opacity: .8; display: block; font-size: 13px; }
.continue strong { font-size: 18px; display: block; }
.continue .go { font-size: 24px; }
.path-week { margin: 28px 0 10px; display: flex; align-items: center; gap: 10px; }
.path-week .wk { background: var(--gold-soft); color: var(--gold); font-weight: 800; font-size: 12px; letter-spacing: .08em; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.path-week h2 { font-size: 17px; margin: 0; }
.path { list-style: none; margin: 0; padding: 4px 0 8px; display: grid; gap: 14px; }
.path li { display: flex; }
.path li:nth-child(4n+1) { justify-content: center; }
.path li:nth-child(4n+2) { justify-content: flex-start; padding-left: 18%; }
.path li:nth-child(4n+3) { justify-content: center; }
.path li:nth-child(4n) { justify-content: flex-end; padding-right: 18%; }
.node { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); width: 112px; text-align: center; }
.node .dot { width: 70px; height: 66px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; background: var(--paper-2); color: var(--muted); box-shadow: 0 6px 0 var(--line); border: 2px solid var(--line); transition: transform .15s var(--ease); }
.node:active .dot { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.node.done .dot { background: var(--ok); color: #fff; border-color: transparent; box-shadow: 0 6px 0 color-mix(in srgb, var(--ok) 60%, #000); }
.node.current .dot { background: var(--cta); color: #fff; border-color: transparent; box-shadow: 0 6px 0 color-mix(in srgb, var(--cta) 65%, #000); animation: pulse 2s infinite; }
.node.open .dot { background: var(--card); color: var(--brand-2); border-color: var(--brand-2); box-shadow: 0 6px 0 var(--brand-soft); }
.node .lbl { font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.node.current .lbl { color: var(--ink); font-weight: 700; }
@keyframes pulse { 0%, 100% { outline: 0 solid color-mix(in srgb, var(--cta) 35%, transparent); } 50% { outline: 8px solid color-mix(in srgb, var(--cta) 0%, transparent); } }
.lock-banner { background: var(--card); border: 2px dashed var(--line); border-radius: var(--radius); padding: 16px; text-align: center; margin: 8px 0; }
.side-cards { display: grid; gap: 12px; margin: 26px 0 60px; }
.mini-card { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); }
.mini-card .ico { font-size: 26px; }
.mini-card p { margin: 0; font-size: 14px; color: var(--ink-2); }
.mini-card strong { display: block; }

/* ---------- reader ---------- */
.lesson-bar { display: flex; align-items: center; gap: 12px; min-height: 58px; }
.lesson-bar .close { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); text-decoration: none; font-size: 22px; flex: none; }
.lesson-bar .close:hover { background: var(--paper-2); }
.lprog { flex: 1; height: 14px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.lprog i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--ok) 80%, #fff), var(--ok)); border-radius: 999px; transition: width .5s var(--ease); box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); }
.reader-head { padding: 24px 0 6px; }
.day-tag { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 800; }
.reader-head h1 { font-family: var(--serif); font-size: clamp(28px, 7.5vw, 40px); margin: 6px 0 4px; }
.reader-head .en { color: var(--ink-2); font-style: italic; margin: 0; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.meta span { font-size: 13px; color: var(--ink-2); background: var(--paper-2); border-radius: 999px; padding: 3px 10px; }
.goal { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--brand-2); padding: 14px 16px; border-radius: 0 14px 14px 0; margin: 18px 0; }
.block { margin: 40px 0; scroll-margin-top: 80px; }
.block > h2 { font-family: var(--serif); font-size: 23px; margin: 0 0 6px; display: flex; gap: 10px; align-items: center; }
.block > h2 .step { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); font-family: var(--sans); font-size: 14px; font-weight: 800; display: grid; place-items: center; flex: none; }
.block > .hint { color: var(--ink-2); font-size: 15px; margin: 0 0 14px; }
.situation { background: var(--paper-2); border-radius: var(--radius); padding: 16px 18px; }
.situation .setting { font-size: 13px; color: var(--muted); margin-top: 6px; font-style: italic; }
.toggle-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.chip { font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; min-height: 38px; }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
:root[data-theme="dark"] .chip[aria-pressed="true"] { color: #0f1d18; }

.dialogue { display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: start; padding: 12px 14px; border-radius: 18px 18px 18px 6px; background: var(--card); border: 1px solid var(--line); max-width: 94%; animation: rise .35s var(--ease) both; }
.line.you { justify-self: end; background: var(--brand-soft); border-color: transparent; border-radius: 18px 18px 6px 18px; }
.line .who { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .03em; }
.line .en { font-size: 18px; line-height: 1.55; }
.line .th { grid-column: 1 / -1; color: var(--ink-2); font-size: 15px; }
.hide-th .line .th, .hide-th .listen-item .th { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.play { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--brand-2); cursor: pointer; display: inline-grid; place-items: center; flex: none; box-shadow: 0 2px 0 var(--line); }
.play:hover { border-color: var(--brand-2); }
.play.playing { background: var(--brand-2); color: #fff; }
.play svg { width: 18px; height: 18px; }

.phrase { padding: 14px 0; border-bottom: 1px dashed var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.phrase .en { font-weight: 700; font-size: 18px; }
.phrase .th { color: var(--ink-2); grid-column: 1; }
.phrase .note { grid-column: 1 / -1; font-size: 15px; color: var(--ink-2); background: var(--paper-2); padding: 10px 12px; border-radius: 10px; margin-top: 6px; }
.explain h3 { font-size: 17px; margin: 22px 0 4px; }
.explain p { margin: 0; color: var(--ink-2); }
.extra ul { margin: 8px 0 0; padding-left: 22px; color: var(--ink-2); }
.extra li { margin: 4px 0; }
.mistake { display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); margin-bottom: 10px; }
.mistake .row { display: flex; gap: 8px; align-items: baseline; }
.mistake .lbl { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.mistake .lbl.x { background: var(--bad-soft); color: var(--bad); }
.mistake .lbl.v { background: var(--ok-soft); color: var(--ok); }
.mistake .wrong { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.mistake .right { color: var(--ok); font-weight: 700; }
.mistake .why { color: var(--ink-2); font-size: 15px; padding-left: 30px; }
.reply { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.reply .prompt { font-size: 18px; font-weight: 700; }
.reply .prompt-th { color: var(--ink-2); font-size: 15px; margin-bottom: 10px; }
.reply .opt { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.reply .tone { font-size: 12px; color: var(--gold); font-weight: 800; grid-column: 1 / -1; }
.reply .opt .th { color: var(--ink-2); font-size: 15px; grid-column: 1; }

/* exercises */
.ex { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow-sm); scroll-margin-top: 90px; }
.ex + .ex { margin-top: 14px; }
.ex-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-2); margin-bottom: 8px; }
.listen-item { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--line); }
.listen-item:first-of-type { border-top: 0; }
.listen-item .th { grid-column: 2; color: var(--ink-2); font-size: 14px; }
.listen-item .en { font-size: 17px; }
.check { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); background: none; cursor: pointer; color: var(--muted); grid-row: span 2; font-weight: 800; }
.check[aria-pressed="true"] { background: var(--ok); color: #fff; border-color: var(--ok); animation: pop .3s var(--ease); }
.tts-note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.rate { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.rate select { font: inherit; font-size: 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 4px 8px; }
.options { display: grid; gap: 10px; margin-top: 14px; }
.option { text-align: left; font: inherit; font-size: 16px; padding: 13px 16px; min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--line); transition: transform .1s var(--ease), border-color .15s; }
.option:hover:not([disabled]) { border-color: var(--brand-2); }
.option:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.option.correct { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 3px 0 color-mix(in srgb, var(--ok) 50%, transparent); animation: pop .35s var(--ease); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 3px 0 color-mix(in srgb, var(--bad) 40%, transparent); animation: shake .4s; }
.option[disabled] { cursor: default; }
.option[disabled]:not(.correct):not(.wrong) { opacity: .6; }
@keyframes pop { 40% { transform: scale(1.03); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.feedback { margin-top: 12px; padding: 14px 16px; border-radius: 14px; font-size: 15px; animation: rise .25s var(--ease); }
.feedback .fb-title { display: block; font-weight: 800; font-size: 17px; margin-bottom: 2px; }
.feedback.ok { background: var(--ok-soft); color: var(--ink); }
.feedback.ok .fb-title { color: var(--ok); }
.feedback.no { background: var(--bad-soft); color: var(--ink); }
.feedback.no .fb-title { color: var(--bad); }
.q-situation { font-weight: 700; font-size: 17px; }
.q-prompt { margin-top: 8px; font-size: 17px; font-style: italic; color: var(--ink-2); background: var(--paper-2); border-radius: 12px; padding: 8px 12px; }
.build-target { min-height: 62px; border-bottom: 2px solid var(--line); padding: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.build-target:empty::before { content: attr(data-empty); color: var(--muted); font-size: 14px; }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 0; }
.tile { font: inherit; font-size: 17px; padding: 8px 14px; min-height: 46px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--line); transition: transform .1s var(--ease); animation: rise .2s var(--ease) both; }
.tile:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.tile.used { visibility: hidden; }
.build-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.mission { background: linear-gradient(160deg, var(--gold-soft), var(--card)); border-radius: 22px; padding: 22px; border: 1px solid var(--line); }
.mission ol { padding-left: 22px; margin: 10px 0; }
.mission .example { background: var(--card); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-style: italic; }
.rec { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.rec p { font-size: 14px; color: var(--ink-2); margin: 0 0 8px; }
.rec audio { width: 100%; margin-top: 8px; }
.finish { text-align: center; padding: 30px 18px; margin: 40px 0; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.finish h2 { font-family: var(--serif); margin: 0 0 6px; }
.finish .btns { display: grid; gap: 12px; max-width: 380px; margin: 18px auto 0; }
.score { color: var(--ink-2); font-size: 15px; }
.lockcard { text-align: center; padding: 32px 20px; margin: 28px 0; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.lockcard .ico { font-size: 40px; }
.lockcard h2 { font-family: var(--serif); margin: 8px 0; }
.lockcard p { color: var(--ink-2); }
.lockcard .btns { display: grid; gap: 12px; max-width: 360px; margin: 18px auto 0; }
.daynav { display: flex; justify-content: space-between; gap: 10px; margin: 24px 0 60px; }

/* toast, celebration, sheets */
.toast-wrap { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-weight: 800; font-size: 15px; box-shadow: var(--shadow-lg); animation: toast 1.6s var(--ease) both; white-space: nowrap; }
.toast.xp { background: var(--xp); color: #fff; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-10px) scale(.9); } 12%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(10, 18, 20, .55); display: grid; place-items: end center; padding: 0; animation: fade .2s both; }
@media (min-width: 640px) { .overlay { place-items: center; padding: 20px; } }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 480px; background: var(--card); color: var(--ink); border-radius: 26px 26px 0 0; padding: 26px 22px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: up .35s var(--ease) both; max-height: 92vh; overflow: auto; }
@media (min-width: 640px) { .sheet { border-radius: 26px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { font-family: var(--serif); margin: 4px 0 6px; font-size: 26px; }
.sheet .big-emoji { font-size: 54px; line-height: 1; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.result-stats div { border: 2px solid var(--line); border-radius: 16px; padding: 10px 6px; }
.result-stats b { display: block; font-size: 22px; }
.result-stats span { font-size: 12px; color: var(--muted); }
.result-stats .xp { border-color: var(--xp); } .result-stats .xp b { color: var(--xp); }
.result-stats .acc { border-color: var(--ok); } .result-stats .acc b { color: var(--ok); }
.result-stats .fl { border-color: var(--flame); } .result-stats .fl b { color: var(--flame); }
.sheet .btns { display: grid; gap: 10px; margin-top: 10px; }
.install-steps { padding-left: 20px; }
.install-steps li { margin: 6px 0; }
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; }

/* forms / panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 24px 20px; box-shadow: var(--shadow); margin: 24px 0; }
.panel h1, .panel h2 { font-family: var(--serif); margin: 0 0 6px; }
label { display: block; font-weight: 700; font-size: 15px; margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=text] { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); min-height: 52px; }
input:focus { border-color: var(--brand-2); outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
.tabs { display: flex; gap: 6px; background: var(--paper-2); padding: 4px; border-radius: 999px; margin: 14px 0 6px; }
.tabs button { flex: 1; font: inherit; font-size: 15px; padding: 10px; border-radius: 999px; border: 0; background: none; color: var(--ink-2); cursor: pointer; min-height: 44px; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0 4px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.alert { padding: 12px 14px; border-radius: 14px; margin: 12px 0; font-size: 15px; }
.alert.error { background: var(--bad-soft); border-left: 4px solid var(--bad); }
.alert.info { background: var(--brand-soft); border-left: 4px solid var(--brand-2); }
.alert.warn { background: var(--gold-soft); border-left: 4px solid var(--gold); }
.agree { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 15px; background: var(--paper-2); padding: 12px 14px; border-radius: 14px; margin: 16px 0; cursor: pointer; }
.agree input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand-2); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--brand-2); border-radius: 50%; animation: spin .9s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { text-align: center; color: var(--muted); padding: 48px 0; }
.prose h2 { font-family: var(--serif); margin-top: 34px; }
.prose p, .prose li { color: var(--ink-2); }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
