/* ==========================================================================
   MuMu…English Buddy — "Quiet luxury" design system
   Warm ivory paper · deep aubergine · brushed gold · serif display
   ========================================================================== */

:root {
  /* surfaces — pure white page, pastel blue menu boxes */
  --paper: #ffffff;
  --paper-2: #f7faff;
  --card: #ffffff;
  --card-2: #f4f8ff;
  --ink: #0f1115;
  --ink-2: #33415c;
  --muted: #7c8aa3;
  --muted-2: #a8b4c9;
  --line: rgba(28, 55, 100, 0.10);
  --line-2: rgba(28, 55, 100, 0.06);

  /* brand — pastel blue family */
  --plum: #7c9ee0;
  --plum-2: #5b7fca;
  --plum-3: #9dbaf0;
  --gold: #4f79c9;
  --gold-2: #a8c4f0;
  --gold-3: #eaf2ff;
  --gold-ink: #ffffff;
  --rose: #b06a8a;
  --blue-1: #eaf2ff;
  --blue-2: #cfe0fa;
  --blue-3: #a8c4f0;
  --blue-4: #7c9ee0;
  --blue-5: #5b7fca;

  /* radii & shadows */
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --shadow-s: 0 1px 2px rgba(40, 70, 130, 0.05), 0 6px 16px -10px rgba(40, 70, 130, 0.25);
  --shadow-m: 0 2px 4px rgba(40, 70, 130, 0.04), 0 18px 40px -24px rgba(40, 70, 130, 0.35);
  --shadow-l: 0 30px 70px -36px rgba(40, 70, 130, 0.45);
  --shadow-dark: 0 22px 44px -24px rgba(70, 100, 170, 0.55);

  /* type */
  --serif: "Fraunces", "Noto Serif Thai", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --thai: "Noto Sans Thai", "Manrope", sans-serif;
  --thai-serif: "Noto Serif Thai", "Fraunces", serif;

  --sp: 20px;
  --nav-h: 70px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--paper);
}

body {
  font-family: var(--sans);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 10px;
}

/* ============================== shell =================================== */
.shell {
  position: relative;
  width: 100%;
  max-width: 468px;
  min-height: 100dvh;
  margin: 0 auto;
  background:
    radial-gradient(120% 55% at 88% -10%, rgba(168, 196, 240, 0.28) 0%, rgba(255, 255, 255, 0) 62%),
    var(--paper);
  overflow: hidden;
  isolation: isolate;
}

@media (min-width: 640px) {
  body {
    background:
      radial-gradient(900px 600px at 50% 0%, #fdfaf3 0%, #efe7d8 45%, #e2d6c1 100%);
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 0;
  }
  .shell {
    height: min(900px, 94vh);
    min-height: 640px;
    border-radius: 46px;
    box-shadow: 0 50px 110px -40px rgba(40, 24, 60, 0.55), 0 0 0 10px rgba(255, 255, 255, 0.5);
  }
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 26px);
}
@media (min-width: 640px) {
  .screen { min-height: 100%; height: 100%; overflow-y: auto; }
}
.screen::-webkit-scrollbar { width: 0; }

.page { padding: 0 var(--sp); position: relative; z-index: 2; }
.stack { display: grid; gap: 16px; }
.stack--sm { gap: 10px; }

/* ============================== type ==================================== */
.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.display {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink);
}
.serif { font-family: var(--serif); }
.th { font-family: var(--thai); font-weight: 400; }
.rule { height: 1px; background: var(--line-2); margin: 4px 0; }

/* ============================== topbar ================================== */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--sp) 10px;
}
.topbar > div:first-child { flex: 1; min-width: 0; }

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 1px;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.wordmark__mu { font-weight: 700; }
.wordmark__dots { color: var(--gold); margin: 0 1px; }
.wordmark__name { font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: -0.01em; }

.iconbtn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: var(--ink-2);
  position: relative;
  transition: transform 0.16s ease, background 0.2s ease;
}
.iconbtn:active { transform: scale(0.94); }
.iconbtn svg { width: 19px; height: 19px; }
.iconbtn--ghost { background: transparent; border-color: transparent; }
.iconbtn .dot {
  position: absolute; top: 10px; right: 11px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--paper);
}

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line), 0 8px 18px -10px rgba(70, 100, 170, 0.32);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 30px; height: 30px; }
.avatar--lg { width: 46px; height: 46px; }
.avatar--ring { box-shadow: 0 0 0 1px var(--gold-2), 0 8px 18px -10px rgba(70, 100, 170, 0.32); }

.backbtn {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  color: var(--ink);
  flex: none;
}
.backbtn svg { width: 19px; height: 19px; }

/* ============================== hero ==================================== */
.hero {
  position: relative;
  margin: 6px var(--sp) 0;
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(90% 90% at 92% 4%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(155deg, #93b3ea 0%, #7c9ee0 52%, #6a8ed8 100%);
  box-shadow: var(--shadow-dark);
  isolation: isolate;
  min-height: 238px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 50% at 10% 110%, rgba(255, 255, 255, 0.28), transparent 70%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  z-index: 2;
  padding: 22px 20px 20px;
  max-width: 64%;
}
.hero__hi {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-top: 10px;
}
.hero__hi em { font-style: italic; color: #eaf2ff; }
.hero__sub {
  font-family: var(--thai);
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.86);
  margin-top: 8px;
  line-height: 1.5;
}
.hero__cta { margin-top: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero__meta {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.hero__art {
  position: absolute;
  right: -16px;
  bottom: -6px;
  height: 94%;
  width: auto;
  max-width: 62%;
  object-fit: contain;
  object-position: bottom right;
  z-index: 1;
  filter: drop-shadow(-10px 18px 30px rgba(60, 90, 155, 0.3));
  -webkit-mask-image: linear-gradient(255deg, #000 62%, transparent 96%);
  mask-image: linear-gradient(255deg, #000 62%, transparent 96%);
  pointer-events: none;
}

/* ============================== buttons ================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 16px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.975); }
.btn svg { width: 18px; height: 18px; }

.btn--gold {
  color: #ffffff;
  background: linear-gradient(135deg, #9dbaf0 0%, #7c9ee0 48%, #6186d2 100%);
  box-shadow: 0 12px 26px -12px rgba(124, 158, 224, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn--dark {
  color: #ffffff;
  background: linear-gradient(140deg, #7c9ee0, #5f83cf 70%);
  box-shadow: 0 18px 34px -18px rgba(70, 100, 170, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.btn--ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
}
.btn--soft {
  background: rgba(28, 55, 100, 0.06);
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}
.chip svg { width: 15px; height: 15px; color: var(--gold); }

/* ============================== cards =================================== */
.card {
  background: var(--card);
  border-radius: var(--r-xl);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-m);
  padding: 18px;
}
.card--flat { box-shadow: var(--shadow-s); }
.card__top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.card__top .chev { margin-left: auto; color: var(--gold); display: grid; place-items: center; }
.card__top .chev svg { width: 17px; height: 17px; }

.section { margin-top: 26px; }
.section__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section__head h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section__head .link {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--gold);
}

/* continue-learning card */
.continue { display: block; }
.lesson-row { display: flex; align-items: center; gap: 14px; }
.lesson-thumb {
  width: 68px; height: 68px;
  border-radius: 18px;
  overflow: hidden;
  flex: none;
  position: relative;
  border: 1px solid var(--line-2);
}
.lesson-meta { min-width: 0; flex: 1; }
.lesson-meta .kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.lesson-meta .title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.22;
  margin-top: 4px;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.play-fab {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #7c9ee0, #5f83cf);
  color: var(--gold-2);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 22px -12px rgba(70, 100, 170, 0.55);
  flex: none;
}
.play-fab svg { width: 16px; height: 16px; }

.progress { margin-top: 14px; display: flex; align-items: center; gap: 10px; }
.progress__track {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(28, 55, 100, 0.10);
  overflow: hidden;
}
.progress__fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.progress__label {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* stat / goal cards */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-s);
  padding: 15px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.stat-card .label { color: var(--muted); }
.stat-card .val {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-card .val small { font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.stat-card .bar { height: 3px; border-radius: 99px; background: rgba(28, 55, 100, 0.09); overflow: hidden; }
.stat-card .bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
}

.ring { position: relative; width: 56px; height: 56px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.ring .track { stroke: rgba(28, 55, 100, 0.10); }
.ring .fill { stroke: url(#ringgrad); transition: stroke-dashoffset 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring__text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring__text b { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.ring__text span { font-size: 8px; color: var(--muted); font-weight: 800; letter-spacing: 0.08em; }

/* quick tiles */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: 16px;
  min-height: 116px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-s);
  transition: transform 0.16s ease;
}
.quick:active { transform: scale(0.98); }
.quick--dark {
  background: linear-gradient(150deg, #93b3ea, #6f92db);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  box-shadow: var(--shadow-m);
}
.quick__icon {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(28, 55, 100, 0.07);
  color: var(--ink);
}
.quick--dark .quick__icon { background: rgba(255, 255, 255, 0.3); color: var(--gold-2); }
.quick__icon svg { width: 18px; height: 18px; }
.quick__text b {
  display: block;
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.quick__text span {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 3px;
  font-family: var(--thai);
}
.quick--dark .quick__text span { color: rgba(255, 255, 255, 0.8); }

/* learning paths */
.path-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.path {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-s);
  text-align: left;
  transition: transform 0.15s ease;
}
.path:active { transform: scale(0.98); }
.path__icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(28, 55, 100, 0.06);
  color: var(--plum-2);
  flex: none;
}
.path__icon svg { width: 17px; height: 17px; }
.path__name { font-size: 12px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.path__range { font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.path.is-soon { opacity: 0.55; }

/* quote */
.quote {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, rgba(168, 196, 240, 0.22), rgba(217, 185, 118, 0.04));
  border: 1px solid rgba(91, 127, 202, 0.2);
}
.quote p {
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink-2);
}
.quote p b {
  font-style: normal; font-weight: 800; display: block; font-size: 9.5px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 5px; font-family: var(--sans);
}

/* ============================== tabbar ================================== */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 468px;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: linear-gradient(180deg, #8fb0ea 0%, #7c9ee0 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 -10px 30px -18px rgba(70, 100, 170, 0.55);
  z-index: 40;
}
@media (min-width: 640px) {
  .tabbar { position: absolute; border-radius: 0 0 46px 46px; }
}
.tab {
  display: grid;
  place-items: center;
  gap: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding-top: 9px;
  position: relative;
  transition: color 0.16s ease;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-active { color: #ffffff; }
.tab.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 22px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: #ffffff;
}
.tab:active { transform: scale(0.95); }

/* ============================== page head ============================== */
.page-head { padding: calc(env(safe-area-inset-top, 0px) + 20px) var(--sp) 4px; }
.page-head h1 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 8px;
  line-height: 1.1;
}
.page-head .sub {
  font-family: var(--thai);
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
}

/* ============================== lesson list ============================= */
.lesson-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-m);
  overflow: hidden;
}
.lesson-card__cover { height: 92px; position: relative; }
.lesson-card__body { padding: 14px 16px 16px; }
.lesson-card__body h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.lesson-card__body .th { font-family: var(--thai); font-size: 12px; color: var(--muted); margin-top: 3px; }
.lesson-card__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(168, 196, 240, 0.22);
  color: var(--gold);
  border: 1px solid rgba(91, 127, 202, 0.22);
}
.lesson-card__meta .dim { font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
.lesson-card__foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; font-size: 11px; font-weight: 700; color: var(--muted);
}
.lesson-card__foot .go {
  margin-left: auto; color: var(--ink); font-weight: 800;
  display: inline-flex; align-items: center; gap: 4px;
}
.lesson-card__foot .go svg { width: 14px; height: 14px; color: var(--gold); }

/* covers */
.cover {
  position: relative;
  overflow: hidden;
  height: 100%;
  width: 100%;
  background: linear-gradient(135deg, var(--c1, #4b2e83), var(--c2, #7c9ee0));
}
.cover::before {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  right: -70px; top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 68%);
  z-index: 0;
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 1px, rgba(255, 255, 255, 0) 1px 14px),
    radial-gradient(80% 120% at 8% 110%, rgba(60, 90, 155, 0.28), rgba(10, 4, 20, 0) 62%);
  z-index: 0;
}
.cover--violet { --c1: #93b3ea; --c2: #7c9ee0; }
.cover--sunset { --c1: #a6c1f0; --c2: #7c9ee0; }
.cover--sky { --c1: #8fb0ea; --c2: #6f92db; }
.cover--emerald { --c1: #93b3ea; --c2: #7c9ee0; }
.cover--rose { --c1: #a6c1f0; --c2: #7c9ee0; }
.cover--graphite { --c1: #9dbaf0; --c2: #6f92db; }

.cover__num {
  position: absolute;
  right: 14px; bottom: -14px;
  z-index: 2;
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.55);
}
.cover__icon {
  position: absolute;
  left: 14px; top: 14px;
  z-index: 2;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(239, 220, 178, 0.35);
  color: var(--gold-3);
}
.cover__icon svg { width: 17px; height: 17px; }
.cover__title {
  position: absolute;
  left: 14px; bottom: 12px;
  z-index: 2;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.02em;
}
.cover__line {
  position: absolute;
  left: 14px; right: 14px; bottom: 8px;
  height: 1px;
  background: linear-gradient(90deg, rgba(239, 220, 178, 0.6), rgba(239, 220, 178, 0));
  z-index: 2;
}
.cover--sm .cover__num { font-size: 30px; right: 8px; bottom: -6px; }
.cover--sm .cover__icon { width: 26px; height: 26px; border-radius: 8px; left: 8px; top: 8px; }
.cover--sm .cover__icon svg { width: 14px; height: 14px; }
.cover--sm .cover__line, .cover--sm .cover__title { display: none; }

/* ============================== lesson detail =========================== */
.lesson-hero { position: relative; margin: 4px var(--sp) 0; }
.lesson-hero__card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  min-height: 190px;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  color: #ffffff;
  box-shadow: var(--shadow-l);
}
.lesson-hero__card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(60, 90, 155, 0.55) 100%);
  z-index: 1;
}
.lesson-hero__card > div { position: relative; z-index: 2; }
.lesson-hero__card .lv {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid rgba(239, 220, 178, 0.5);
  color: var(--gold-3);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.lesson-hero__card h1 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.02em;
}
.lesson-hero__card p { font-family: var(--thai); font-size: 12.5px; opacity: 0.82; margin-top: 5px; }

.phrase-list { display: grid; gap: 10px; }
.phrase-item {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-s);
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
}
.phrase-item__n {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: rgba(176, 138, 62, 0.10);
  border: 1px solid rgba(91, 127, 202, 0.2);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
}
.phrase-item__body { min-width: 0; flex: 1; }
.phrase-item__en {
  display: block;
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.phrase-item__th {
  display: block;
  font-family: var(--thai);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.45;
}
.phrase-item__play { color: var(--muted); flex: none; }
.phrase-item__play svg { width: 18px; height: 18px; }
.phrase-item.is-done .phrase-item__n { background: rgba(28, 55, 100, 0.07); border-color: transparent; color: var(--plum-2); }

/* ============================== practice =============================== */
.practice { min-height: 100dvh; display: flex; flex-direction: column; }
@media (min-width: 640px) { .practice { min-height: 100%; } }

.practice__top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) var(--sp) 0;
}
.practice__title { font-family: var(--serif); font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.practice__progress { padding: 14px var(--sp) 0; display: flex; align-items: center; gap: 12px; }
.practice__progress .progress__track { height: 3px; }
.practice__count {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stage { position: relative; margin: 10px var(--sp) 0; flex: 1; display: flex; flex-direction: column; }

.luna-stage {
  position: relative;
  height: 226px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  --amp: 0;
}
.luna-stage__glow {
  position: absolute;
  left: 50%; top: 56%;
  width: 280px; height: 280px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5), rgba(217, 185, 118, 0) 66%);
  opacity: calc(0.5 + var(--amp) * 0.4);
  filter: blur(10px);
  transition: opacity 0.2s linear;
  pointer-events: none;
}
.luna-stage__frame {
  position: relative;
  height: 100%;
  aspect-ratio: 777 / 745;
  z-index: 1;
  border-radius: 130px 130px 26px 26px;
  overflow: hidden;
  background: linear-gradient(180deg, #fbf6ea, #f2e8d6);
  border: 1px solid rgba(176, 138, 62, 0.28);
  box-shadow: var(--shadow-m), inset 0 0 0 5px rgba(255, 255, 255, 0.6);
}
.luna-stage__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
  display: block;
  -webkit-user-drag: none;
  pointer-events: none;
}

.say-bubble {
  position: relative;
  z-index: 3;
  margin: -14px auto 12px;
  max-width: 300px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: var(--shadow-m);
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 500;
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.45;
  text-align: center;
}
.say-bubble strong { font-style: normal; font-weight: 600; color: var(--ink); }
.say-bubble .heart { color: var(--rose); }

.phrase-card {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-m);
  padding: 22px 18px 18px;
  text-align: center;
}
.phrase-card__en {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: -0.02em;
}
.phrase-card__th {
  font-family: var(--thai);
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.55;
}
.phrase-card__row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }
.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(28, 55, 100, 0.06);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 9px 15px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 12px;
}
.speak-btn svg { width: 15px; height: 15px; color: var(--gold); }
.speak-btn.is-playing { background: var(--plum); color: var(--gold-3); border-color: transparent; }
.speak-btn.is-playing svg { color: var(--gold-2); }
.rate {
  border-radius: 12px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  font-size: 11.5px;
}
.rate.is-slow { background: rgba(168, 196, 240, 0.22); border-color: rgba(91, 127, 202, 0.3); color: var(--gold); }

.mic-zone { display: grid; justify-items: center; gap: 10px; padding: 20px 0 10px; position: relative; }
.mic {
  width: 104px; height: 104px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--gold-3);
  background: radial-gradient(circle at 34% 26%, #8fb0ea 0%, #6f92db 52%, #5b7fca 100%);
  border: 1px solid rgba(217, 185, 118, 0.45);
  box-shadow: 0 22px 40px -18px rgba(70, 100, 170, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  position: relative;
  transition: transform 0.16s ease, box-shadow 0.2s ease;
  z-index: 2;
}
.mic svg { width: 34px; height: 34px; }
.mic:active { transform: scale(0.96); }
.mic::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px solid rgba(176, 138, 62, 0.30);
  opacity: calc(0.55 + var(--amp, 0) * 0.9);
  transform: scale(calc(1 + var(--amp, 0) * 0.14));
  pointer-events: none;
}
.mic.is-rec {
  color: #fff;
  background: radial-gradient(circle at 34% 26%, #b4677a 0%, #8f4055 48%, #5f2233 100%);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 22px 44px -18px rgba(143, 64, 85, 0.85);
}
.mic-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-align: center;
}
.mic-label small {
  display: block;
  font-family: var(--thai);
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0;
}

.timer { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.live-wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 46px; width: 100%; padding: 0 8px; }
.live-wave i {
  flex: 1 1 auto; max-width: 5px; border-radius: 99px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  height: 6px; opacity: 0.5;
  transition: height 0.07s linear, opacity 0.2s ease;
}
.live-wave.is-live i { opacity: 1; }

.practice__tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 0 12px; }
.tool {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-s);
  padding: 11px 6px;
  display: grid;
  justify-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.tool svg { width: 17px; height: 17px; color: var(--gold); }
.tool:active { transform: scale(0.97); }

.playback {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-s);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.playback__btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #7c9ee0, #5f83cf);
  color: var(--gold-2);
  border: 1px solid rgba(255, 255, 255, 0.5);
  flex: none;
}
.playback__btn svg { width: 16px; height: 16px; }
.playback__wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; }
.playback__wave i { flex: 1; border-radius: 99px; background: rgba(70, 100, 170, 0.10); height: calc(5px + (var(--h, 0.4) * 18px)); }
.playback__wave i.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.playback__time { font-size: 10.5px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }

.action-row { display: flex; gap: 10px; padding-top: 6px; }
.action-row .btn { flex: 1; }

.feedback {
  display: flex; align-items: center; gap: 11px;
  background: var(--card-2);
  border: 1px solid rgba(91, 127, 202, 0.2);
  border-radius: var(--r-md);
  padding: 11px 13px;
}
.feedback .avatar { width: 38px; height: 38px; }
.feedback p { font-family: var(--thai); font-size: 12px; font-weight: 500; color: var(--ink-2); line-height: 1.45; }
.feedback p b { display: block; font-family: var(--sans); font-size: 12px; font-weight: 800; color: var(--ink); margin-bottom: 2px; }

/* ============================== luna chat ============================== */
.chat { display: flex; flex-direction: column; gap: 14px; padding: 14px var(--sp) 0; }
.msg { display: flex; gap: 9px; align-items: flex-end; max-width: 90%; }
.msg--luna { align-self: flex-start; }
.msg--me { align-self: flex-end; flex-direction: row-reverse; }
.msg__bubble {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 18px 18px 18px 6px;
  padding: 12px 15px;
  box-shadow: var(--shadow-s);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-2);
  line-height: 1.5;
}
.msg--me .msg__bubble {
  background: linear-gradient(150deg, #7c9ee0, #5f83cf);
  color: #ffffff;
  border-color: transparent;
  border-radius: 18px 18px 6px 18px;
  font-family: var(--thai);
  font-weight: 500;
  font-size: 13px;
}
.msg__th {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-2);
  font-family: var(--thai);
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.55;
}
.msg__listen {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 9px;
  font-family: var(--sans);
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}
.msg__listen svg { width: 13px; height: 13px; }

.suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px var(--sp) 0; }
.suggestion {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 9px 14px;
  font-family: var(--thai);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  box-shadow: var(--shadow-s);
}
.suggestion:active { transform: scale(0.97); }

.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-2); animation: typing 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

/* ============================== summary ================================ */
.summary { text-align: center; padding: calc(env(safe-area-inset-top, 0px) + 26px) var(--sp) 0; }
.summary__stage { position: relative; height: 210px; display: grid; place-items: end center; margin-bottom: 6px; }
.summary__stage .luna-stage { height: 100%; }
.summary h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 10px;
}
.summary p.lead {
  font-family: var(--thai);
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 8px;
  line-height: 1.55;
}
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-s);
  padding: 14px 8px;
  display: grid; gap: 3px; justify-items: center;
}
.stat b { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1; }
.stat span { font-family: var(--thai); font-size: 10px; font-weight: 500; color: var(--muted); }
.summary .actions { display: grid; gap: 10px; margin-top: 20px; }

/* ============================== toast / sheet ========================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 20px);
  transform: translate(-50%, 14px);
  background: rgba(26, 16, 40, 0.96);
  color: #ffffff;
  font-family: var(--thai);
  font-size: 12.5px;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(217, 185, 118, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90;
  max-width: 320px;
  text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.hint-sheet {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 100;
  background: var(--paper-2);
  border-radius: 28px 28px 0 0;
  border-top: 1px solid rgba(91, 127, 202, 0.3);
  padding: 20px var(--sp) calc(22px + var(--safe-b));
  box-shadow: 0 -30px 60px -20px rgba(70, 100, 170, 0.3);
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.hint-sheet.is-open { transform: translateY(0); }
.hint-sheet h3 { font-family: var(--serif); font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.hint-sheet p { font-family: var(--thai); font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.hint-sheet .say {
  margin-top: 12px;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line-2);
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 500;
}
.hint-sheet .close { margin-top: 16px; width: 100%; }

.scrim {
  position: fixed; inset: 0;
  background: rgba(26, 16, 40, 0.45);
  backdrop-filter: blur(3px);
  z-index: 99; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.scrim.is-on { opacity: 1; pointer-events: auto; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.empty-note { text-align: center; font-family: var(--thai); font-size: 11.5px; color: var(--muted); padding: 6px 0; line-height: 1.6; }

[hidden] { display: none !important; }

/* ============================== animations ============================= */
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
@keyframes typing {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.hero__art { animation: floaty 9s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* short phones */
@media (max-height: 680px) {
  .practice .luna-stage { height: 150px; }
  .luna-stage__frame { border-radius: 90px 90px 22px 22px; }
  .phrase-card { padding: 16px 14px; }
  .phrase-card__en { font-size: 19px; }
  .mic { width: 84px; height: 84px; }
  .mic svg { width: 28px; height: 28px; }
  .mic-zone { padding: 12px 0 6px; gap: 7px; }
  .mic-label small { display: none; }
  .practice__tools { padding-bottom: 6px; }
  .tool { padding: 8px 4px; font-size: 9.5px; }
}

/* ============================== additions =============================== */
.lesson-hero__card .cover { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }

.cta-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 468px;
  padding: 14px var(--sp) calc(14px + var(--safe-b));
  background: linear-gradient(180deg, rgba(245, 239, 228, 0) 0%, rgba(245, 239, 228, 0.92) 38%, var(--paper) 70%);
  z-index: 30;
}
.screen.has-cta { padding-bottom: calc(96px + var(--safe-b)); }

/* practice: character is static, only the glow responds to the voice */
.luna-stage__frame { transform: none; }

/* hero art blends into the dark card without a visible crop line */
.hero__art {
  right: -10px;
  height: 92%;
  max-width: 58%;
  -webkit-mask-image: radial-gradient(115% 112% at 68% 42%, #000 54%, rgba(0, 0, 0, 0) 90%);
  mask-image: radial-gradient(115% 112% at 68% 42%, #000 54%, rgba(0, 0, 0, 0) 90%);
  filter: drop-shadow(-8px 14px 26px rgba(10, 4, 20, 0.4)) saturate(1.02);
}
.wordmark { gap: 0; }
.wordmark__dots { margin: 0; letter-spacing: 0.01em; }
.hero__inner { max-width: 60%; }

/* gentler arch so Luna's hair is not clipped by the curve */
.luna-stage__frame { border-radius: 96px 96px 24px 24px; }
.luna-stage__img { object-position: 50% 50%; }
@media (max-height: 680px) {
  .luna-stage__frame { border-radius: 76px 76px 20px 20px; }
}

.cover__num { font-size: 48px; right: 12px; bottom: -12px; }
.cover--sm .cover__num { font-size: 26px; }

/* portrait sits inside the arch like a matted print */
.luna-stage__img {
  object-fit: contain;
  transform: scale(0.92);
  transform-origin: 50% 60%;
}

/* chat: composer pinned to the bottom of the viewport */
.chat-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 96px - var(--nav-h) - var(--safe-b));
}
.chat-page .chat { flex: 1; }
.chat-composer { padding: 18px var(--sp) 4px; }

.btn--soft {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  box-shadow: none;
}
.summary { padding-top: calc(env(safe-area-inset-top, 0px) + 40px); }

.chat-guide {
  margin-top: 6px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.35));
  border: 1px solid var(--line-2);
}
.chat-guide ol { display: grid; gap: 10px; margin-top: 12px; }
.chat-guide li { display: flex; align-items: center; gap: 10px; }
.chat-guide li b {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  width: 24px;
  letter-spacing: 0.02em;
}
.chat-guide li span { font-family: var(--thai); font-size: 12.5px; color: var(--ink-2); }
.chat-guide li em { font-style: normal; font-weight: 700; font-family: var(--sans); }

/* ============================ word highlighting ======================== */
.phrase-card__en .w {
  display: inline-block;
  padding: 0 2px;
  border-radius: 6px;
  transition: color 0.14s ease, background 0.18s ease;
}
.phrase-card__en .w.is-spoken { color: var(--muted-2); }
.phrase-card__en .w.is-current {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(239, 220, 178, 0.55), rgba(217, 185, 118, 0.38));
  box-shadow: inset 0 -1px 0 rgba(91, 127, 202, 0.35);
}
.phrase-card__en .w.is-missed {
  color: var(--rose);
  background: rgba(157, 85, 102, 0.08);
  text-decoration: underline wavy rgba(157, 85, 102, 0.45);
  text-underline-offset: 4px;
}

/* ================================ score ================================= */
.score-card {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-m);
  padding: 18px;
  margin-top: 6px;
}
.score-card__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.score-card__num { display: flex; align-items: baseline; gap: 2px; }
.score-card__num b { font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.score-card__num span { font-size: 11px; font-weight: 800; color: var(--muted); }
.score-card__bar {
  height: 4px; border-radius: 99px; background: rgba(28, 55, 100, 0.09);
  overflow: hidden; margin: 12px 0;
}
.score-card__bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.score-words { display: flex; flex-wrap: wrap; gap: 6px; }
.score-word {
  font-family: var(--serif);
  font-size: 12.5px;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: rgba(28, 55, 100, 0.05);
  color: var(--ink-2);
}
.score-word.is-hit { border-color: rgba(91, 127, 202, 0.3); background: rgba(255, 255, 255, 0.3); color: var(--gold); }
.score-word.is-miss { border-color: rgba(157, 85, 102, 0.28); background: rgba(157, 85, 102, 0.08); color: var(--rose); }
.score-note { font-family: var(--thai); font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.score-note b { color: var(--rose); font-weight: 600; }
.score-card .action-row { margin-top: 14px; padding-top: 0; }

/* ============================ helper button ============================= */
.help-fab {
  position: fixed;
  right: max(18px, calc(50% - 216px));
  bottom: calc(22px + var(--safe-b));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 15px;
  border-radius: 99px;
  background: linear-gradient(140deg, #7c9ee0, #5f83cf);
  color: var(--gold-2);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 30px -14px rgba(70, 100, 170, 0.55);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  font-family: var(--thai);
}
.help-fab svg { width: 16px; height: 16px; }
.help-fab:active { transform: scale(0.96); }

/* ============================== exam ==================================== */
.exam-tag {
  align-self: center;
  margin-bottom: 4px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.exam-rules { display: grid; gap: 10px; margin-top: 12px; }
.exam-rules li { display: flex; gap: 10px; align-items: baseline; }
.exam-rules li b { font-family: var(--serif); color: var(--gold); font-size: 12px; width: 22px; flex: none; }
.exam-rules li span { font-family: var(--thai); font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.exam-pass {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2);
  font-family: var(--thai); font-size: 12px; color: var(--muted);
}
.exam-pass b { font-family: var(--serif); font-size: 15px; color: var(--gold); }

.exam-result { text-align: center; }
.exam-result h1 { font-family: var(--serif); font-size: 27px; font-weight: 600; margin-top: 8px; letter-spacing: -0.02em; }
.exam-score { display: flex; align-items: baseline; justify-content: center; gap: 3px; margin-top: 12px; }
.exam-score b { font-family: var(--serif); font-size: 46px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.exam-score span { font-size: 12px; font-weight: 800; color: var(--muted); }
.exam-sub { font-family: var(--thai); font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ============================ confetti ================================== */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}
.confetti-layer i {
  position: absolute;
  top: 34%;
  animation: confetti-fall var(--dur, 2s) cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
  opacity: 0;
}
@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translate(var(--dx, 0px), 52vh) rotate(var(--rot, 540deg)); opacity: 0; }
}

/* ============================ exam banner =============================== */
.exam-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(140deg, #7c9ee0, #5f83cf 75%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow-m);
  color: #ffffff;
}
.exam-banner__icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.3);
  color: var(--gold-2);
  flex: none;
}
.exam-banner__icon svg { width: 19px; height: 19px; }
.exam-banner__text { min-width: 0; flex: 1; }
.exam-banner__text b {
  display: block;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.exam-banner__text span {
  display: block;
  font-family: var(--thai);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 3px;
}
.exam-banner__go { color: var(--gold-2); flex: none; }
.exam-banner__go svg { width: 18px; height: 18px; }

/* settings: version readout */
.version-box {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.version-box > div {
  flex: 1;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(28, 55, 100, 0.05);
  border: 1px solid var(--line-2);
}
.version-box .label { display: block; font-size: 9.5px; }
.version-box b {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- contrast pass for the white / pastel-blue theme ---------- */
.hero .eyebrow { color: rgba(255, 255, 255, 0.88); }
.hero__hi { color: #ffffff; }
.hero__sub { color: rgba(255, 255, 255, 0.9); }
.hero__meta { color: rgba(255, 255, 255, 0.8); }
.hero .btn--gold {
  background: #ffffff;
  color: #33517f;
  box-shadow: 0 14px 28px -14px rgba(40, 70, 130, 0.6);
}
.progress__fill { background: linear-gradient(90deg, #7c9ee0, #5b7fca); }
.progress__label { color: #4f79c9; }
.quick--dark .quick__text b,
.quick--dark .quick__text span { color: #ffffff; }
.quick--dark .quick__text span { color: rgba(255, 255, 255, 0.82); }
.exam-banner__text b { color: #ffffff; }
.exam-banner__text span { color: rgba(255, 255, 255, 0.82); }
.cover__title, .cover__icon { color: #ffffff; }
.cover__icon { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.45); }
.badge { background: rgba(124, 158, 224, 0.14); border-color: rgba(124, 158, 224, 0.28); color: #3f68b8; }
.msg--me .msg__bubble { color: #ffffff; }
.exam-banner { box-shadow: 0 18px 34px -20px rgba(70, 100, 170, 0.6); }
.say-bubble strong { color: var(--ink); }
.tools .tool { color: #33415c; }

/* final contrast tuning */
.hero {
  background:
    radial-gradient(70% 80% at 96% 0%, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(158deg, #7c9ee0 0%, #6a8ed8 55%, #5b7fca 100%);
}
.quick--dark .quick__icon { background: rgba(255, 255, 255, 0.24); color: #ffffff; }
.quick--dark .quick__icon svg { color: #ffffff; }
.play-fab { background: linear-gradient(140deg, #7c9ee0, #5b7fca); color: #fff; border-color: rgba(255,255,255,.5); }
.playback__btn { background: linear-gradient(140deg, #7c9ee0, #5b7fca); color: #fff; }
.mic { color: #ffffff; }
.mic::after { border-color: rgba(124, 158, 224, 0.45); }
.tool svg { color: #5b7fca; }
.speak-btn svg { color: #5b7fca; }
.rate.is-slow { background: rgba(124, 158, 224, 0.16); border-color: rgba(124, 158, 224, 0.35); color: #3f68b8; }
.msg__listen { color: #4f79c9; }
.section__head .link, .lesson-card__foot .go svg, .card__top .chev { color: #5b7fca; }
.phrase-item__n { background: rgba(124, 158, 224, 0.12); border-color: rgba(124, 158, 224, 0.22); color: #3f68b8; }
.score-word.is-hit { border-color: rgba(124, 158, 224, 0.35); background: rgba(124, 158, 224, 0.14); color: #3f68b8; }
.chat-guide li b { color: #5b7fca; }

/* portrait mat in the blue theme */
.luna-stage__frame {
  background: linear-gradient(180deg, #f6f9ff, #e8f1ff);
  border-color: rgba(124, 158, 224, 0.35);
  box-shadow: var(--shadow-m), inset 0 0 0 5px rgba(255, 255, 255, 0.85);
}

/* ============================ mic status =============================== */
.mic-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--blue-1);
  border: 1px solid rgba(124, 158, 224, 0.25);
}
.mic-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(124, 158, 224, 0.16);
}
.mic-status[data-state="on"] { color: #2f5ba8; background: rgba(124, 158, 224, 0.16); }
.mic-status[data-state="on"] i { background: #4f79c9; animation: micpulse 1.4s ease-in-out infinite; }
.mic-status[data-state="wait"] i { background: #d9a441; }
@keyframes micpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 121, 201, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(79, 121, 201, 0); }
}
