:root {
  --ink: #102f33;
  --ink-soft: #38565a;
  --muted: #718589;
  --paper: #fbf8f1;
  --paper-deep: #f1eadc;
  --white: #fffefb;
  --teal: #0c7169;
  --teal-dark: #08554f;
  --teal-light: #d9f2eb;
  --coral: #f46f54;
  --coral-dark: #d9543c;
  --gold: #e7ad36;
  --gold-light: #f8e8b9;
  --line: rgba(16, 47, 51, 0.12);
  --shadow: 0 24px 60px rgba(33, 58, 55, 0.12);
  --shadow-small: 0 9px 26px rgba(33, 58, 55, 0.09);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(231, 173, 54, 0.15), transparent 27rem),
    radial-gradient(circle at 92% 8%, rgba(12, 113, 105, 0.12), transparent 30rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 22rem),
    var(--paper);
  font-family: "Noto Sans Lao", "Lao UI", "Leelawadee UI", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

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

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.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;
}

h1,
h2,
h3 {
  line-height: 1.1;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2.75rem, 6vw, 5.7rem);
  font-weight: 760;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 720;
}

h3 {
  font-size: 1.35rem;
}

.site-shell {
  width: min(100% - 38px, 1280px);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.86);
  backdrop-filter: blur(18px) saturate(1.15);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--white);
  background: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.07em;
  transform: rotate(-3deg);
  box-shadow: 5px 5px 0 var(--gold);
}

.brand-mark span {
  color: var(--gold);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 4px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.9rem;
  font-weight: 650;
}

.main-nav > a:not(.button) {
  padding: 8px 0;
}

.main-nav > a:not(.button):hover,
.text-link:hover {
  color: var(--teal);
}

.user-chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-weight: 800;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 8px 0;
  font-weight: 650;
}

.text-button:hover {
  color: var(--coral-dark);
}

.button {
  display: inline-flex;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.2;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 0 5px 0 rgba(16, 47, 51, 0.16);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(16, 47, 51, 0.12);
}

.button:disabled,
.button:disabled:hover {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.button-small {
  min-height: 42px;
  padding: 0 17px;
  font-size: 0.84rem;
}

.button-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(16, 47, 51, 0.25);
  box-shadow: none;
}

.button-ghost:hover {
  background: var(--white);
  box-shadow: var(--shadow-small);
}

.button-light {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
  box-shadow: none;
}

.button-light:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

.button-full {
  width: 100%;
}

.eyebrow {
  margin-bottom: 16px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.muted-copy {
  color: var(--muted);
}

.message-stack {
  margin-top: 18px;
}

.message {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--teal-light);
  border: 1px solid rgba(12, 113, 105, 0.2);
  color: var(--teal-dark);
  font-weight: 600;
}

.hero {
  min-height: 690px;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
  padding: 80px 0 90px;
}

.hero-copy h1 {
  max-width: 760px;
  margin-bottom: 26px;
}

.hero-copy h1 span {
  color: var(--teal);
  position: relative;
  white-space: nowrap;
}

.hero-copy h1 span::after {
  content: "";
  position: absolute;
  left: 2%;
  bottom: 1px;
  width: 94%;
  height: 11px;
  border-radius: 999px;
  background: var(--gold);
  opacity: 0.55;
  z-index: -1;
  transform: rotate(-1deg);
}

.hero-lead {
  max-width: 620px;
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1.7;
}

.hero-lead-lao {
  max-width: 650px;
  margin: 10px 0 0;
  color: var(--teal-dark);
  font-size: 1.06rem;
  font-weight: 560;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin: 38px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  color: var(--muted);
  font-size: 0.82rem;
}

.trust-row strong {
  display: inline-block;
  color: var(--ink);
  font-size: 1.1rem;
  margin-right: 4px;
}

.hero-visual {
  position: relative;
  min-height: 480px;
  display: grid;
  place-items: center;
}

.hero-visual::before {
  content: "";
  position: absolute;
  width: min(470px, 90%);
  height: 430px;
  border-radius: 46% 54% 53% 47% / 43% 37% 63% 57%;
  background: var(--teal);
  transform: rotate(-4deg);
}

.scene-card {
  width: min(430px, 92%);
  padding: 26px;
  position: relative;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
  z-index: 2;
}

.scene-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lesson-pill {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--gold-light);
  color: #7f5412;
  letter-spacing: 0.05em;
}

.character-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.character-row-right {
  justify-content: flex-end;
}

.avatar {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  font-weight: 800;
  border: 3px solid var(--white);
  box-shadow: 0 4px 14px rgba(16, 47, 51, 0.15);
}

.avatar-nok {
  background: var(--gold);
}

.avatar-alex {
  background: var(--coral);
  color: var(--white);
}

.dialogue-bubble {
  max-width: 260px;
  padding: 13px 16px;
  border-radius: 4px 18px 18px 18px;
  background: var(--teal-light);
}

.dialogue-bubble.bubble-coral {
  border-radius: 18px 4px 18px 18px;
  background: #ffe2d9;
}

.dialogue-bubble strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dialogue-bubble p {
  margin: 0;
  font-size: 0.93rem;
}

.scene-progress {
  margin-top: 28px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.scene-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.77rem;
}

.scene-progress strong {
  color: var(--ink);
}

.mini-track {
  height: 7px;
  overflow: hidden;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--paper-deep);
}

.mini-track span {
  display: block;
  width: 26%;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
}

.floating-note {
  position: absolute;
  z-index: 3;
  padding: 12px 16px;
  border-radius: 13px;
  background: var(--white);
  box-shadow: var(--shadow-small);
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

.floating-note strong {
  color: var(--ink);
}

.note-one {
  left: 0;
  bottom: 52px;
  transform: rotate(-4deg);
}

.note-two {
  right: 4px;
  top: 8px;
  color: var(--white);
  background: var(--coral);
  transform: rotate(5deg);
  font-weight: 700;
}

.section-block {
  padding: 88px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 42px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading-row {
  max-width: none;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
}

.text-link {
  color: var(--teal);
  font-weight: 750;
  font-size: 0.92rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  min-height: 280px;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 254, 251, 0.65);
}

.feature-card.feature-accent {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
  transform: translateY(-16px);
}

.feature-number {
  display: block;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0.1em;
  margin-bottom: 88px;
}

.feature-card h3 {
  margin-bottom: 14px;
  font-size: 1.55rem;
}

.feature-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.feature-accent p {
  color: rgba(255, 254, 251, 0.67);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.preview-unit {
  min-height: 230px;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--white);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.preview-unit:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-small);
}

.preview-unit:nth-child(2n) {
  background: var(--teal-light);
}

.unit-kicker {
  display: block;
  margin-bottom: 30px;
  color: var(--coral-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-unit h3 {
  margin-bottom: 10px;
}

.preview-unit p {
  color: var(--muted);
  font-size: 0.9rem;
}

.unit-meta {
  display: block;
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 0.77rem;
  font-weight: 700;
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin: 40px 0 70px;
  padding: 50px;
  border-radius: var(--radius-xl);
  background: var(--teal);
  color: var(--white);
  box-shadow: var(--shadow);
}

.cta-band .eyebrow {
  color: var(--gold-light);
}

.cta-band h2 {
  margin-bottom: 0;
  max-width: 720px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0;
}

.footer-note {
  text-align: right;
}

/* Dashboard */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  padding: 64px 0 42px;
}

.dashboard-header h1 {
  margin-bottom: 8px;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.score-ring {
  flex: 0 0 142px;
  width: 142px;
  height: 142px;
  padding: 12px;
  border-radius: 50%;
  background: conic-gradient(var(--coral) calc(var(--progress) * 1%), var(--paper-deep) 0);
  box-shadow: inset 0 0 0 1px rgba(16, 47, 51, 0.05);
}

.score-ring-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: var(--white);
}

.score-ring strong {
  font-size: 1.7rem;
  letter-spacing: -0.05em;
}

.score-ring span {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 650;
}

.resume-card {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 30px;
  padding: 30px 34px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-small);
}

.resume-number {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 254, 251, 0.4);
  color: var(--gold);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.resume-label {
  color: var(--gold-light);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.resume-copy h2 {
  margin: 7px 0 7px;
  font-size: 2rem;
}

.resume-copy p {
  margin: 0;
  color: rgba(255, 254, 251, 0.66);
  font-size: 0.9rem;
}

.resume-card .button {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
  box-shadow: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.stat-card {
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--line);
}

.stat-card > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.stat-card strong {
  display: block;
  margin-top: 16px;
  font-size: 2.35rem;
  line-height: 1;
  letter-spacing: -0.07em;
}

.stat-card strong small {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0;
}

.stat-card .stat-text {
  color: var(--teal);
}

.stat-accent {
  background: var(--gold-light);
}

.dashboard-course {
  padding-bottom: 60px;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.unit-card {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.unit-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-small);
}

.unit-card.is-complete {
  background: linear-gradient(160deg, var(--white), var(--teal-light));
}

.unit-card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.unit-number {
  color: var(--teal);
  font-size: 1.4rem;
  font-weight: 820;
  letter-spacing: -0.08em;
}

.status-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-new {
  background: var(--gold-light);
  color: #7d5312;
}

.status-complete {
  background: var(--teal);
  color: var(--white);
}

.unit-card h3 {
  margin: 28px 0 10px;
  font-size: 1.3rem;
}

.unit-card p {
  flex: 1;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 20px;
}

.unit-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.card-track {
  width: 70px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.card-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
}

.attempt-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}

.attempt-row {
  display: grid;
  grid-template-columns: 100px 1fr auto 80px;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}

.attempt-row:last-child {
  border-bottom: 0;
}

.attempt-row:hover {
  background: var(--paper);
}

.attempt-unit {
  color: var(--teal);
  font-weight: 750;
}

.attempt-row > span:nth-child(3) {
  color: var(--muted);
  font-size: 0.78rem;
}

.attempt-score {
  justify-self: end;
  font-weight: 800;
}

.score-pass {
  color: var(--teal);
}

.score-retry {
  color: var(--coral-dark);
}

.empty-state {
  padding: 38px;
  border: 1px dashed rgba(16, 47, 51, 0.24);
  border-radius: var(--radius-md);
  text-align: center;
  background: rgba(255, 254, 251, 0.55);
}

.empty-state h2,
.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

/* Lesson */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 26px 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.breadcrumb a:hover {
  color: var(--teal);
}

.lesson-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  padding: 40px 0 50px;
}

.lesson-hero h1 {
  margin-bottom: 16px;
  font-size: clamp(2.6rem, 5vw, 5rem);
}

.lesson-story {
  max-width: 750px;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.lesson-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.lesson-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.lesson-audio-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 32px;
  padding: 17px 19px;
  border: 1px solid rgba(12, 113, 105, 0.18);
  border-radius: var(--radius-md);
  background: var(--teal-light);
}

.lesson-audio-bar > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  grid-column: 1;
}

.lesson-audio-bar strong {
  font-size: 0.9rem;
}

.lesson-audio-bar span {
  color: var(--teal-dark);
  font-size: 0.74rem;
}

.dialogue-position {
  margin-top: 3px;
  font-weight: 750;
}

.dialogue-read-progress {
  width: 100%;
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.13);
}

.dialogue-read-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 220ms ease;
}

.lesson-audio-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.lesson-audio-actions .button-small {
  min-height: 38px;
}

.speech-status {
  flex-basis: 100%;
  text-align: right;
  font-size: 0.68rem !important;
}

.speech-status:not(:empty) {
  margin-left: auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.09);
  color: var(--teal-dark);
  font-weight: 750;
}

.audio-mode-switch {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1;
  gap: 5px;
}

.audio-mode {
  padding: 5px 9px;
  border: 1px solid rgba(12, 113, 105, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.67rem;
  font-weight: 700;
}

.audio-mode:hover,
.audio-mode.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.audio-mode:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.dialogue-translation-toggle {
  white-space: nowrap;
}

.dialogue-translation-toggle[aria-pressed="true"] {
  border-color: rgba(231, 173, 54, 0.45);
  background: var(--gold-light);
  color: var(--ink);
}

.dialogue-audio-element {
  width: 100%;
  margin: -18px 0 30px;
  accent-color: var(--teal);
}

.dialogue-audio-cluster {
  margin: 20px 0 26px;
}

.dialogue-audio-cluster .lesson-audio-bar {
  margin-bottom: 12px;
}

.dialogue-audio-cluster .dialogue-audio-element {
  margin: 0;
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: start;
  padding-bottom: 80px;
}

.lesson-content {
  position: relative;
  --reader-font-scale: 1;
  min-width: 0;
  overflow-x: clip;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-small);
}

.lesson-content::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral));
}

.reader-toolbar {
  position: sticky;
  top: 92px;
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: -38px -38px 30px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: rgba(255, 254, 251, 0.93);
  backdrop-filter: blur(16px);
}

.reader-toc-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.reader-toolbar-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-toc {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

@media (min-width: 581px) {
  .reader-toc {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 4px;
  }
}

.reader-toc::-webkit-scrollbar {
  display: none;
}

.reader-toc button,
.reader-controls button {
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.reader-toc button {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.reader-toc button:hover,
.reader-toc button.is-active {
  border-color: rgba(12, 113, 105, 0.2);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.reader-toc button.is-viewed::before {
  content: "✓";
  margin-right: 4px;
  color: var(--teal);
  font-weight: 900;
}

.reader-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 9px;
  border-left: 1px solid var(--line);
}

.reader-controls button {
  border-color: var(--line);
  background: var(--white);
}

.reader-controls button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.reader-focus-button {
  white-space: nowrap;
}

.reader-resume-button {
  border-color: rgba(231, 173, 54, 0.45) !important;
  background: var(--gold-light) !important;
  color: #745016 !important;
}

.reader-show-all {
  border-color: rgba(231, 173, 54, 0.5) !important;
  background: var(--gold-light) !important;
  color: #745016 !important;
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: 3px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral));
  box-shadow: 0 1px 8px rgba(244, 111, 84, 0.42);
}

.lesson-content > :first-child {
  margin-top: 0;
}

.lesson-content h1,
.lesson-content h2 {
  font-size: 2rem;
  margin: 48px 0 18px;
}

.lesson-content h3 {
  margin: 36px 0 15px;
  color: var(--teal-dark);
  font-size: 1.42rem;
}

.section-learning-tip {
  margin: 8px 0 20px !important;
  padding: 10px 13px;
  border: 1px solid rgba(231, 173, 54, 0.28);
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  background: rgba(248, 232, 185, 0.36);
  color: var(--ink-soft) !important;
  font-size: 0.79rem !important;
  line-height: 1.65;
}

.section-learning-tip::before {
  content: "ວິທີຮຽນ · ";
  color: #8a6219;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.pronunciation-instruction-lao {
  margin: -4px 0 14px !important;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--teal-light);
  color: var(--teal-dark) !important;
  font-size: 0.8rem !important;
  font-weight: 650;
}

.pronunciation-study-panel {
  display: grid;
  gap: 11px;
  margin: 12px 0 16px;
  padding: 13px 14px;
  border: 1px solid rgba(12, 113, 105, 0.14);
  border-radius: 13px;
  background:
    radial-gradient(circle at 95% 0, rgba(231, 173, 54, 0.1), transparent 14rem),
    var(--paper);
}

.pronunciation-study-progress {
  display: grid;
  gap: 6px;
}

.pronunciation-study-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pronunciation-study-progress strong {
  color: var(--ink);
  font-size: 0.72rem;
}

.pronunciation-progress-count {
  color: var(--teal-dark);
  font-size: 0.63rem;
  font-weight: 750;
}

.pronunciation-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.12);
}

.pronunciation-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 220ms ease;
}

.pronunciation-study-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pronunciation-study-steps > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 0.63rem;
  font-weight: 650;
}

.pronunciation-study-steps > span strong {
  color: var(--gold);
  font-size: 0.58rem;
}

.pronunciation-next {
  min-height: 30px;
  margin-left: auto;
  padding: 4px 9px;
  border: 1px solid rgba(12, 113, 105, 0.17);
  border-radius: 999px;
  background: var(--white);
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.63rem;
  font-weight: 750;
}

.pronunciation-study-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.pronunciation-cards {
  display: grid;
  gap: 10px;
  margin: 16px 0 24px;
}

.pronunciation-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 7px 20px rgba(33, 58, 55, 0.06);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.pronunciation-card.is-correct {
  border-color: rgba(12, 113, 105, 0.45);
  box-shadow: 0 9px 24px rgba(12, 113, 105, 0.12);
}

.pronunciation-card.needs-practice {
  border-color: rgba(231, 173, 54, 0.48);
}

.pronunciation-card.is-current-practice {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 113, 105, 0.1), var(--shadow-small);
}

.pronunciation-card-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: #8a6219;
  font-size: 0.61rem;
  font-weight: 850;
}

.pronunciation-card-content {
  min-width: 0;
}

.pronunciation-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.pronunciation-form > span:first-child {
  color: var(--muted);
  font-size: 0.86rem;
}

.pronunciation-arrow {
  color: var(--teal);
  font-size: 1rem;
  font-weight: 900;
}

.pronunciation-form strong {
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.45;
}

.pronunciation-card-status {
  width: max-content;
  display: inline-flex;
  margin-top: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 750;
}

.pronunciation-card-status.is-new {
  background: rgba(95, 111, 109, 0.1);
  color: var(--muted);
}

.pronunciation-card-status.is-listened {
  background: var(--gold-light);
  color: #755019;
}

.pronunciation-card-status.needs-practice {
  background: #fff1ed;
  color: #8a3828;
}

.pronunciation-card-status.is-correct {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.pronunciation-guide-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
  color: var(--teal-dark);
  font-size: 0.78rem;
}

.pronunciation-ipa {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gold-light);
  color: #785119;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 750;
}

.pronunciation-tip {
  margin: 7px 0 10px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.65;
}

.pronunciation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pronunciation-actions button {
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid rgba(12, 113, 105, 0.2);
  border-radius: 999px;
  background: var(--teal-light);
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.69rem;
  font-weight: 800;
}

.pronunciation-actions button[data-listening="true"] {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.pronunciation-actions .pronunciation-record {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.pronunciation-actions button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.pronunciation-result {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.65;
}

.pronunciation-result.is-correct {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.pronunciation-result.needs-practice {
  background: var(--gold-light);
  color: #6f4c10;
}

.speaking-studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  margin: 16px 0 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 95% 0, rgba(231, 173, 54, 0.11), transparent 17rem),
    var(--paper);
}

.speaking-studio-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.speaking-starters,
.speaking-recorder,
.speaking-transcript,
.speaking-self-check {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.speaking-starters-heading,
.speaking-recorder-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.speaking-starters-heading strong,
.speaking-recorder-heading strong {
  color: var(--ink);
  font-size: 0.76rem;
}

.speaking-starters-heading span,
.speaking-recorder-heading span {
  color: var(--muted);
  font-size: 0.62rem;
}

.speaking-starter-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.speaking-starter {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(12, 113, 105, 0.12);
  border-radius: 9px;
  background: var(--teal-light);
  color: var(--teal-dark);
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 650;
  text-align: left;
}

.speaking-starter:hover {
  border-color: rgba(12, 113, 105, 0.28);
  background: #d8f2e9;
}

.speaking-starter.speaking-model {
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-start;
  cursor: default;
  padding: 14px;
  font-size: 0.92rem;
  line-height: 1.65;
}

.speaking-model small { font-weight: 400; }
.speaking-model .pronunciation-controls { margin-top: auto; }

.speaking-recorder-heading > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.speaking-timer {
  flex: 0 0 auto;
  color: var(--teal-dark) !important;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.speaking-recorder-meta {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
}

.speaking-best-score {
  color: var(--muted);
  font-size: 0.58rem;
}

.speaking-timer-track {
  height: 7px;
  overflow: hidden;
  margin-bottom: 11px;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.12);
}

.speaking-timer-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 180ms linear;
}

.speaking-recorder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.speaking-record,
.speaking-stop {
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.speaking-record {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}

.speaking-stop {
  border: 1px solid var(--coral);
  background: var(--coral);
  color: var(--white);
}

.speaking-record:disabled,
.speaking-stop:disabled {
  cursor: wait;
  opacity: 0.58;
}

.speaking-status {
  margin: 9px 0 0 !important;
  color: var(--muted) !important;
  font-size: 0.69rem !important;
  line-height: 1.6;
}

.speaking-playback {
  width: 100%;
  margin-top: 10px;
  accent-color: var(--teal);
}

.speaking-transcript {
  border-color: rgba(12, 113, 105, 0.15);
  background: var(--teal-light);
}

.speaking-transcript strong {
  color: var(--teal-dark);
  font-size: 0.7rem;
}

.speaking-transcript p {
  margin: 5px 0 0 !important;
  color: var(--ink) !important;
  font-size: 0.78rem !important;
  line-height: 1.65;
}

.speaking-transcript small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.5;
}

.speaking-score-panel {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(12, 113, 105, 0.16);
  border-radius: 13px;
  background:
    radial-gradient(circle at 92% 0, rgba(231, 173, 54, 0.13), transparent 15rem),
    var(--white);
}

.speaking-score-panel[hidden] {
  display: none;
}

.speaking-score-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.speaking-score-heading strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.speaking-score-level {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.speaking-score-level.is-excellent,
.speaking-score-level.is-pass {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.speaking-score-level.needs-practice {
  background: var(--gold-light);
  color: #6f4c10;
}

.speaking-score-total {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.speaking-score-total strong {
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
}

.speaking-score-total span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.speaking-score-breakdown {
  display: grid;
  gap: 7px;
}

.speaking-score-breakdown > div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
}

.speaking-score-breakdown span,
.speaking-score-breakdown b {
  color: var(--ink-soft);
  font-size: 0.63rem;
}

.speaking-score-breakdown b {
  color: var(--teal-dark);
  text-align: right;
}

.speaking-score-breakdown > div > div {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.12);
}

.speaking-score-breakdown i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 260ms ease;
}

.speaking-score-feedback {
  margin: 0 !important;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--gold-light);
  color: #6f4c10 !important;
  font-size: 0.7rem !important;
  line-height: 1.6;
}

.speaking-best-note {
  color: var(--teal-dark);
  font-size: 0.62rem;
  font-weight: 700;
}

.speaking-self-check {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.speaking-self-check .eyebrow {
  margin-bottom: 0;
}

.speaking-self-check > strong {
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.5;
}

.speaking-self-check label {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding: 8px;
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1.5;
}

.speaking-self-check input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--teal);
}

.speaking-self-check label:has(input:checked) {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.speaking-check-progress {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding-top: 5px;
}

.speaking-check-progress > span {
  color: var(--teal-dark);
  font-size: 0.64rem;
  font-weight: 750;
  text-align: right;
}

.speaking-check-progress > div {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.12);
}

.speaking-check-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 180ms ease;
}

.writing-studio {
  display: grid;
  gap: 12px;
  margin: 16px 0 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 96% 0, rgba(217, 242, 235, 0.65), transparent 18rem),
    var(--paper);
}

.writing-studio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.writing-studio-header .eyebrow {
  margin-bottom: 2px;
}

.writing-studio-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
}

.writing-checklist-progress {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--white);
  color: var(--teal-dark);
  font-size: 0.64rem;
  font-weight: 750;
}

.writing-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 10px;
}

.writing-editor-card,
.writing-requirements-card,
.writing-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.writing-editor-card {
  min-width: 0;
  padding: 13px;
}

.writing-editor-card > label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 0.71rem;
  font-weight: 800;
}

.writing-editor-card textarea {
  width: 100%;
  min-height: 190px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: calc(0.84rem * var(--reader-font-scale));
  line-height: 1.7;
  outline: 0;
  resize: vertical;
}

.writing-editor-card textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 113, 105, 0.1);
}

.writing-editor-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.61rem;
}

.writing-save-status {
  margin-left: auto;
  color: var(--teal-dark);
  font-weight: 700;
}

.writing-editor-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.writing-editor-actions .button {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 0.65rem;
}

.writing-clear {
  margin-left: auto;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 700;
}

.writing-clear:hover {
  color: #8a3828;
}

.writing-ai-note {
  margin: 7px 0 0 !important;
  color: var(--muted) !important;
  font-size: 0.61rem !important;
  line-height: 1.55;
}

.writing-requirements-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px;
}

.writing-requirements-card .eyebrow {
  margin-bottom: 0;
}

.writing-requirements-card > strong {
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1.45;
}

.writing-requirements {
  display: grid;
  gap: 5px;
}

.writing-requirements label {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding: 7px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.66rem;
  line-height: 1.45;
}

.writing-requirements label:has(input:checked) {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.writing-requirements label.is-detected {
  box-shadow: inset 3px 0 0 var(--teal);
}

.writing-requirements input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
}

.writing-requirement-english {
  display: block;
  font-weight: 750;
}

.writing-requirement-lao {
  display: block;
  margin-top: 2px;
  color: var(--teal-dark);
  font-size: 0.61rem;
  line-height: 1.5;
}

.writing-word-bank {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.writing-word-bank summary {
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 750;
}

.writing-word-bank-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  max-height: 170px;
  overflow-y: auto;
}

.writing-word-bank-list button {
  display: grid;
  gap: 1px;
  padding: 5px 7px;
  border: 1px solid rgba(12, 113, 105, 0.13);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
}

.writing-word-bank-list button:hover {
  background: var(--teal-light);
}

.writing-word-bank-list strong {
  color: var(--teal-dark);
  font-size: 0.63rem;
}

.writing-word-bank-list span {
  color: var(--muted);
  font-size: 0.57rem;
}

.writing-score-rubric {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
}

.writing-requirements-card .writing-score-rubric summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.35;
}

.writing-requirements-card .writing-score-rubric ul {
  display: grid;
  gap: 2px;
  margin: 5px 0 0;
  padding-left: 0.85rem;
}

.writing-requirements-card .writing-score-rubric li {
  color: var(--ink-soft);
  font-size: 0.58rem;
  line-height: 1.4;
  margin-bottom: 0;
}

.writing-checklist-track {
  height: 6px;
  overflow: hidden;
  margin-top: auto;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.12);
}

.writing-checklist-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 180ms ease;
}

.writing-preview {
  padding: 12px 13px;
  background: #f8fcfb;
}

.writing-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.writing-preview-heading strong {
  color: var(--teal-dark);
  font-size: 0.7rem;
}

.writing-preview-heading span {
  color: var(--muted);
  font-size: 0.59rem;
}

.writing-preview-text {
  margin: 7px 0 0 !important;
  color: var(--ink-soft) !important;
  font-size: 0.76rem !important;
  line-height: 1.7;
  white-space: pre-wrap;
}

.writing-review-result {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(12, 113, 105, 0.16);
  border-radius: 13px;
  background: var(--white);
}

.writing-review-result[hidden] {
  display: none;
}

.writing-review-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.writing-review-heading > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.writing-review-heading strong {
  color: var(--ink);
  font-size: 0.76rem;
}

.writing-practice-disclaimer {
  margin: -2px 0 0 !important;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--teal-light);
  color: var(--teal-dark) !important;
  font-size: 0.64rem !important;
  line-height: 1.55;
}

.writing-detected-count {
  color: var(--muted);
  font-size: 0.61rem;
}

.writing-review-level {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.writing-review-level.is-excellent,
.writing-review-level.is-pass {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.writing-review-level.needs-practice {
  background: var(--gold-light);
  color: #6f4c10;
}

.writing-review-total {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.writing-review-total strong {
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: 2.8rem;
  line-height: 1;
}

.writing-review-total span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.writing-review-breakdown {
  display: grid;
  gap: 6px;
}

.writing-review-breakdown > div {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
}

.writing-review-breakdown span,
.writing-review-breakdown b {
  color: var(--ink-soft);
  font-size: 0.62rem;
}

.writing-review-breakdown b {
  color: var(--teal-dark);
  text-align: right;
}

.writing-review-breakdown > div > div {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.12);
}

.writing-review-breakdown i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 260ms ease;
}

.writing-review-feedback {
  margin: 0 !important;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--gold-light);
  color: #6f4c10 !important;
  font-size: 0.69rem !important;
  line-height: 1.6;
}

.writing-review-issues {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 1.1rem;
}

.writing-review-issues li {
  color: var(--ink-soft);
  font-size: 0.66rem;
  line-height: 1.5;
}

.writing-review-best {
  color: var(--teal-dark);
  font-size: 0.61rem;
  font-weight: 700;
}

.listening-play-button {
  min-height: 38px;
  margin: 2px 0 16px;
  padding: 7px 13px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
}

.listening-play-button:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.listening-question-list {
  display: grid;
  gap: 9px;
  margin: 0 0 16px;
  padding: 0 !important;
  list-style: none;
}

.listening-question-list li {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
}

.listening-question-list strong {
  color: var(--ink);
  font-size: 0.85rem;
}

.listening-question-list span {
  color: var(--teal-dark);
  font-size: 0.78rem;
  line-height: 1.6;
}

.listening-answer-key {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(231, 173, 54, 0.35);
  border-radius: 11px;
  background: rgba(248, 232, 185, 0.28);
}

.listening-answer-key summary {
  color: #785119;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.listening-answer-key ul {
  margin: 10px 0 0;
}

.listening-answer-key li {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.lesson-quiz-progress {
  display: grid;
  gap: 9px;
  margin: 14px 0 16px;
  padding: 13px 14px;
  border: 1px solid rgba(12, 113, 105, 0.14);
  border-radius: 13px;
  background:
    radial-gradient(circle at 96% 0, rgba(231, 173, 54, 0.1), transparent 14rem),
    var(--paper);
}

.lesson-quiz-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lesson-quiz-progress-heading strong {
  color: var(--ink);
  font-size: 0.72rem;
}

.lesson-quiz-progress-count {
  color: var(--teal-dark);
  font-size: 0.64rem;
  font-weight: 750;
}

.lesson-quiz-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.12);
}

.lesson-quiz-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 220ms ease;
}

.lesson-quiz-question-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lesson-quiz-question-nav button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.59rem;
  font-weight: 800;
}

.lesson-quiz-question-nav button.is-answered {
  border-color: rgba(12, 113, 105, 0.22);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.lesson-quiz-question-nav button.is-correct {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.lesson-quiz-question-nav button.needs-practice {
  border-color: rgba(217, 84, 60, 0.4);
  background: #fff1ed;
  color: #8a3828;
}

.lesson-quiz-progress > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.55;
}

.lesson-quiz-progress.needs-practice {
  border-color: rgba(231, 173, 54, 0.34);
  background: rgba(255, 248, 229, 0.9);
}

.listening-mc-form {
  display: grid;
  gap: 14px;
  margin: 18px 0 26px;
}

.listening-mc-question {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 7px 20px rgba(33, 58, 55, 0.05);
}

.listening-mc-question legend {
  width: 100%;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 3px 9px;
  padding: 0 4px;
}

.listening-question-number {
  grid-row: 1 / span 2;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-light);
  color: #785119;
  font-size: 0.58rem;
  font-weight: 850;
}

.listening-mc-question legend strong {
  color: var(--ink);
  font-size: 0.85rem;
}

.listening-question-lao {
  color: var(--teal-dark);
  font-size: 0.76rem;
  line-height: 1.55;
}

.listening-mc-question .option-list {
  margin-top: 12px;
}

.listening-mc-question .answer-option {
  align-items: flex-start;
  padding: 10px 12px;
}

.listening-mc-question.is-answered {
  border-color: rgba(12, 113, 105, 0.2);
}

.listening-mc-question .answer-option:has(input:checked) {
  border-color: rgba(12, 113, 105, 0.3);
  background: rgba(217, 242, 235, 0.5);
}

.listening-mc-question .answer-option > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.listening-mc-question .answer-option strong {
  color: inherit;
  font-size: 0.79rem;
}

.listening-mc-question .answer-option small {
  color: var(--teal-dark);
  font-size: 0.7rem;
  font-weight: 500;
}

.listening-mc-question .answer-option.is-correct {
  border-color: rgba(12, 113, 105, 0.5);
  background: var(--teal-light);
  box-shadow: inset 4px 0 0 var(--teal);
}

.listening-mc-question .answer-option.is-wrong {
  border-color: rgba(217, 84, 60, 0.5);
  background: #fff1ed;
  box-shadow: inset 4px 0 0 var(--coral);
}

.listening-mc-question .answer-option:has(input:disabled) {
  cursor: default;
}

.listening-question-feedback {
  margin: 10px 0 0 !important;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-soft) !important;
  font-size: 0.74rem !important;
}

.listening-mc-question.is-correct .listening-question-feedback {
  background: var(--teal-light);
}

.listening-mc-question.needs-practice .listening-question-feedback {
  background: var(--gold-light);
}

.listening-quiz-result {
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.65;
}

.listening-quiz-result.is-correct {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.listening-quiz-result.needs-practice {
  background: var(--gold-light);
  color: #6f4c10;
}

.listening-quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.listening-quiz-actions button:disabled {
  cursor: default;
  opacity: 0.55;
}

.lesson-content p,
.lesson-content li {
  color: var(--ink-soft);
  font-size: calc(1rem * var(--reader-font-scale));
}

.can-do-lao {
  display: block;
  margin-top: 3px;
  color: var(--teal-dark);
  font-size: calc(0.84rem * var(--reader-font-scale));
  line-height: 1.65;
}

.can-do-lao::before {
  content: "ລາວ";
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.1);
  color: var(--teal-dark);
  font-size: 0.64em;
  font-weight: 850;
  letter-spacing: 0.04em;
  vertical-align: 0.08em;
}

.lesson-content strong {
  color: var(--ink);
}

.lesson-content ul,
.lesson-content ol {
  padding-left: 1.3rem;
}

.lesson-content li {
  margin-bottom: 8px;
}

.lesson-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: 24px 0 32px;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.9rem;
}

.lesson-content th,
.lesson-content td {
  min-width: 105px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: calc(0.9rem * var(--reader-font-scale));
}

.lesson-content th {
  background: var(--paper);
  color: var(--ink);
  font-size: calc(0.73rem * var(--reader-font-scale));
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lesson-content tbody tr:nth-child(even) {
  background: rgba(241, 234, 220, 0.26);
}

.language-focus-guide ~ table th:first-child,
.language-focus-guide ~ table td:first-child {
  width: 54%;
  color: var(--ink);
  font-weight: 620;
}

.language-focus-guide ~ table th:last-child,
.language-focus-guide ~ table td:last-child {
  color: var(--teal-dark);
}

.language-focus-guide ~ table tbody tr:nth-child(even) {
  background: rgba(217, 242, 235, 0.24);
}

.language-focus-guide ~ table tbody tr.is-speaking td {
  background: var(--gold-light);
  color: var(--ink);
}

.language-focus-guide ~ table tbody tr.is-speaking td:first-child {
  box-shadow: inset 4px 0 0 var(--gold);
}

.lesson-content blockquote {
  margin: 24px 0;
  padding: 22px 24px;
  border-left: 5px solid var(--coral);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #fff4f0;
}

.lesson-content blockquote p {
  margin-bottom: 12px;
  scroll-margin-top: 210px;
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.dialogue-line-lao {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.86em;
  font-weight: 550;
  line-height: 1.7;
}

.dialogue-line-lao-marker {
  display: inline-flex;
  align-items: center;
  margin-right: 7px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.1);
  color: var(--teal-dark);
  font-size: 0.66em;
  font-weight: 850;
  vertical-align: 1px;
}

.dialogue-coach {
  margin: 18px 0 16px;
  padding: 17px;
  border: 1px solid rgba(12, 113, 105, 0.15);
  border-radius: 15px;
  background:
    radial-gradient(circle at 90% 0, rgba(231, 173, 54, 0.12), transparent 16rem),
    var(--paper);
}

.dialogue-coach-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.dialogue-coach-header .eyebrow {
  margin-bottom: 2px;
}

.dialogue-coach-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
}

.dialogue-coach-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialogue-coach-progress {
  flex: 0 0 auto;
  min-width: 45px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--white);
  color: var(--teal-dark);
  font-size: 0.63rem;
  font-weight: 800;
  text-align: center;
}

.dialogue-coach-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: var(--white);
}

.dialogue-coach-tabs button {
  min-height: 30px;
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 750;
}

.dialogue-coach-tabs button.is-active {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.dialogue-coach-mode > p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 0.77rem;
  line-height: 1.65;
}

.dialogue-coach-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.dialogue-coach-status {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 650;
}

.dialogue-role-speakers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.dialogue-role-speakers button {
  min-height: 33px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.67rem;
  font-weight: 700;
}

.dialogue-role-speakers button.is-active {
  border-color: rgba(12, 113, 105, 0.22);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.lesson-content blockquote p {
  position: relative;
  margin-right: -8px;
  margin-left: -8px;
  padding: 7px 9px 7px 48px;
  border-radius: 9px;
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.lesson-content blockquote p::before {
  content: attr(data-speaker-initials);
  position: absolute;
  top: 8px;
  left: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.lesson-content blockquote p > strong {
  font-weight: 800;
}

.lesson-content blockquote p.speaker-tone-0::before {
  background: var(--teal);
}

.lesson-content blockquote p.speaker-tone-0 > strong {
  color: var(--teal-dark);
}

.lesson-content blockquote p.speaker-tone-1::before {
  background: var(--coral);
}

.lesson-content blockquote p.speaker-tone-1 > strong {
  color: #a74431;
}

.lesson-content blockquote p.speaker-tone-2::before {
  background: #b17a20;
}

.lesson-content blockquote p.speaker-tone-2 > strong {
  color: #785119;
}

.lesson-content blockquote p.speaker-tone-3::before {
  background: #506f7d;
}

.lesson-content blockquote p.speaker-tone-3 > strong {
  color: #3c5a66;
}

.lesson-content blockquote p.is-dialogue-active {
  background: var(--white);
  box-shadow: inset 4px 0 0 var(--teal), 0 7px 18px rgba(33, 58, 55, 0.08);
}

.lesson-content blockquote p.is-dialogue-repeat {
  background: var(--gold-light);
  box-shadow: inset 4px 0 0 var(--gold), 0 7px 18px rgba(175, 124, 24, 0.12);
}

.lesson-content blockquote p.is-role-turn {
  background: #e7f6f0;
  box-shadow: inset 4px 0 0 var(--teal), 0 0 0 2px rgba(12, 113, 105, 0.1);
}

.lesson-content blockquote.is-coach-running p:not(.is-dialogue-active):not(.is-role-turn) {
  opacity: 0.48;
}

.lesson-content blockquote p.is-dialogue-repeat[data-repeat-count]::after {
  content: attr(data-repeat-count);
  position: absolute;
  top: 8px;
  right: 8px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 850;
  animation: dialogueCountdown 1s ease-in-out infinite;
}

@keyframes dialogueCountdown {
  50% {
    transform: scale(1.09);
  }
}

.dialogue-line-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  transition: opacity 160ms ease;
}

.lesson-content blockquote.is-coach-running .dialogue-line-actions {
  opacity: 0.28;
}

.lesson-content blockquote.is-coach-running p.is-dialogue-active .dialogue-line-actions {
  opacity: 1;
}

.dialogue-line-actions button {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid rgba(12, 113, 105, 0.14);
  border-radius: 999px;
  background: rgba(255, 254, 251, 0.8);
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 700;
}

.dialogue-line-actions button:hover {
  background: var(--teal-light);
}

.lesson-content blockquote p:last-child {
  margin-bottom: 0;
}

.lesson-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--paper-deep);
  font-size: 0.88em;
}

.vocab-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 36px 0 15px;
}

.vocab-heading-row h3 {
  margin: 0;
}

.vocabulary-listen {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid rgba(12, 113, 105, 0.2);
  border-radius: 999px;
  background: var(--teal-light);
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
}

.vocabulary-listen:hover,
.vocabulary-listen[data-playing="true"] {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.vocabulary-example-toggle {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.69rem;
  font-weight: 750;
}

.vocabulary-example-toggle[aria-pressed="true"] {
  border-color: rgba(231, 173, 54, 0.45);
  background: var(--gold-light);
  color: var(--ink);
}

.vocabulary-example-toggle:hover {
  border-color: var(--teal);
}

.vocabulary-example-lao {
  display: block;
  margin-top: 4px;
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 550;
  line-height: 1.55;
}

.vocabulary-example-lao::before {
  content: "ລາວ · ";
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.vocabulary-read-progress-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: -5px 0 15px;
  padding: 9px 12px;
  border: 1px solid rgba(12, 113, 105, 0.14);
  border-radius: 12px;
  background: rgba(217, 242, 235, 0.58);
}

.lesson-content.section-isolated .vocabulary-read-progress-panel {
  position: sticky;
  top: var(--reader-sticky-bottom, 220px);
  z-index: 12;
  background: #e7f6f0;
  box-shadow: 0 7px 18px rgba(33, 58, 55, 0.1);
}

.vocabulary-read-position {
  color: var(--teal-dark);
  font-size: 0.7rem;
  font-weight: 750;
}

.vocabulary-read-track {
  flex: 1 1 180px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.13);
}

.vocabulary-read-track-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 220ms ease;
}

.vocab-study-hub {
  margin: 0 0 15px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 254, 251, 0.88);
  box-shadow: 0 7px 20px rgba(33, 58, 55, 0.045);
}

.vocab-mode-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 9px;
  scrollbar-width: none;
}

.vocab-mode-tabs::-webkit-scrollbar {
  display: none;
}

.vocab-mode-tab {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
}

.vocab-mode-tab:hover {
  background: var(--paper);
}

.vocab-mode-tab.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.vocab-mode-tab > span:first-child {
  font-size: 0.82rem;
  line-height: 1;
}

.vocab-study-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.vocab-search {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--muted);
}

.vocab-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 113, 105, 0.1);
}

.vocab-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: 0;
  font: inherit;
  font-size: 0.76rem;
}

.vocab-filter-pills {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.vocab-filter-pills::-webkit-scrollbar {
  display: none;
}

.vocab-filter-pill {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 700;
}

.vocab-filter-pill[aria-pressed="true"] {
  border-color: rgba(12, 113, 105, 0.2);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.vocab-result-count {
  min-width: 48px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: right;
}

.vocab-study-summary {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(100px, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: 11px;
  background: var(--teal-light);
}

.vocab-study-summary > div:first-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.vocab-study-summary strong {
  color: var(--teal-dark);
  font-size: 0.7rem;
}

.vocab-summary-count {
  color: var(--muted);
  font-size: 0.61rem;
}

.vocab-summary-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.13);
}

.vocab-summary-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 220ms ease;
}

.vocab-summary-action {
  min-height: 31px;
  padding: 4px 9px;
  border: 1px solid rgba(12, 113, 105, 0.17);
  border-radius: 999px;
  background: var(--white);
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.64rem;
  font-weight: 750;
  white-space: nowrap;
}

.vocab-summary-action:hover {
  background: var(--teal);
  color: var(--white);
}

.vocabulary-word-button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.vocabulary-word-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.vocab-pictogram {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(12, 113, 105, 0.16);
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.95), transparent 42%),
    linear-gradient(145deg, #edf8f4, #fff7e8);
  color: var(--teal-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.vocab-pictogram svg {
  display: block;
  width: 72%;
  height: 72%;
}

.vocab-pictogram-row {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.vocab-flashcard-visual {
  display: grid;
  place-items: center;
}

.vocab-pictogram-flashcard {
  width: 86px;
  height: 86px;
  border-radius: 23px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(12, 113, 105, 0.1);
}

.vocab-pictogram-practice {
  width: 44px;
  height: 44px;
  margin-right: 8px;
  border-radius: 12px;
  vertical-align: middle;
}

.vocab-pictogram-review {
  width: 42px;
  height: 42px;
  border-radius: 11px;
}

.vocab-pictogram-detail {
  width: 104px;
  height: 104px;
  border-radius: 25px;
  box-shadow: 0 12px 28px rgba(12, 113, 105, 0.11);
}

.vocabulary-word-button:hover {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.vocab-status-badge {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.57rem;
  font-weight: 750;
  line-height: 1.2;
}

.vocab-status-badge.is-new {
  background: rgba(95, 111, 109, 0.1);
  color: var(--muted);
}

.vocab-status-badge.is-learning {
  background: var(--gold-light);
  color: #77521a;
}

.vocab-status-badge.is-mastered {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.vocab-study-area {
  margin: 0 0 24px;
}

.vocab-mode-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 0, rgba(220, 241, 235, 0.78), transparent 18rem),
    var(--white);
  box-shadow: 0 10px 28px rgba(33, 58, 55, 0.06);
}

.vocab-mode-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.vocab-mode-heading .eyebrow {
  margin-bottom: 3px;
}

.vocab-mode-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1.15rem;
}

.vocab-mode-progress,
.vocab-practice-score,
.vocab-review-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--teal-dark);
  font-size: 0.68rem;
  font-weight: 750;
}

.vocab-flashcard-stage {
  min-height: 340px;
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.vocab-flashcard {
  position: relative;
  width: min(100%, 610px);
  min-height: 320px;
  outline: 0;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.vocab-flashcard:focus-visible {
  border-radius: 18px;
  box-shadow: 0 0 0 4px rgba(12, 113, 105, 0.15);
}

.vocab-flashcard.is-flipped {
  transform: rotateY(180deg);
}

.vocab-flashcard-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 28px;
  border: 1px solid rgba(12, 113, 105, 0.16);
  border-radius: 18px;
  backface-visibility: hidden;
  text-align: center;
}

.vocab-flashcard-front {
  background:
    radial-gradient(circle at 50% 0, rgba(231, 173, 54, 0.18), transparent 15rem),
    var(--white);
}

.vocab-flashcard-back {
  transform: rotateY(180deg);
  background: #edf8f4;
}

.vocab-flashcard-label {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.vocab-flashcard-face > strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
}

.vocab-flashcard-back > strong {
  color: var(--teal-dark);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.vocab-flashcard-face small,
.flashcard-example-lao {
  color: var(--muted);
  font-size: 0.7rem;
}

.flashcard-example {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.flashcard-example-lao {
  margin: 0;
  color: var(--teal-dark);
}

.vocab-audio-button {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(12, 113, 105, 0.18);
  border-radius: 999px;
  background: var(--teal-light);
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.69rem;
  font-weight: 750;
}

.vocab-flashcard-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.vocab-mastery-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.vocab-mastery-actions > span {
  margin-right: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

.vocab-mastery-actions button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 700;
}

.vocab-mastery-actions button[aria-pressed="true"] {
  border-color: rgba(12, 113, 105, 0.2);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.vocab-practice-card {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.vocab-practice-progress {
  height: 6px;
  overflow: hidden;
  margin-bottom: 18px;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.12);
}

.vocab-practice-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 220ms ease;
}

.vocab-practice-prompt {
  margin: 0 0 15px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.vocab-practice-prompt strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.vocab-inline-audio {
  margin-left: 6px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  cursor: pointer;
}

.vocab-practice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.vocab-practice-option {
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  text-align: left;
}

.vocab-practice-option:hover {
  border-color: rgba(12, 113, 105, 0.25);
  background: var(--teal-light);
}

.vocab-practice-option.is-correct {
  border-color: rgba(12, 113, 105, 0.45);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.vocab-practice-option.is-wrong {
  border-color: rgba(217, 84, 60, 0.4);
  background: #fff1ed;
  color: #8a3828;
}

.vocab-practice-option:disabled {
  cursor: default;
}

.vocab-practice-feedback {
  margin-top: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.76rem;
  line-height: 1.6;
}

.vocab-practice-feedback.is-correct {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.vocab-practice-feedback.needs-practice {
  background: var(--gold-light);
  color: #6f4c10;
}

.vocab-practice-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.vocab-review-list {
  display: grid;
  gap: 9px;
}

.vocab-review-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.vocab-review-item > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.vocab-review-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.vocab-review-item strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.vocab-review-item span {
  color: var(--teal-dark);
  font-size: 0.76rem;
}

.vocab-review-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.vocab-review-item > div:last-child {
  display: flex;
  gap: 5px;
}

.vocab-review-item button {
  min-height: 31px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 700;
}

.vocab-review-item button.is-mastered {
  border-color: rgba(12, 113, 105, 0.18);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.vocab-review-empty {
  display: grid;
  gap: 4px;
  padding: 26px;
  border: 1px dashed rgba(12, 113, 105, 0.24);
  border-radius: 12px;
  background: var(--teal-light);
  text-align: center;
}

.vocab-review-empty strong {
  color: var(--teal-dark);
}

.vocab-review-empty span {
  color: var(--muted);
  font-size: 0.76rem;
}

.vocab-drawer {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  justify-content: flex-end;
}

.vocab-drawer[hidden] {
  display: none;
}

.vocab-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 34, 34, 0.42);
  cursor: default;
  opacity: 0;
  transition: opacity 180ms ease;
  backdrop-filter: blur(3px);
}

.vocab-drawer-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 94vw);
  height: 100%;
  overflow-y: auto;
  padding: 25px;
  background: var(--paper);
  box-shadow: -18px 0 50px rgba(16, 47, 51, 0.18);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.vocab-drawer.is-open .vocab-drawer-backdrop {
  opacity: 1;
}

.vocab-drawer.is-open .vocab-drawer-panel {
  transform: translateX(0);
}

body.vocab-drawer-open {
  overflow: hidden;
}

.vocab-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.vocab-drawer-kicker {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.09em;
}

.vocab-drawer-header h3 {
  margin: 3px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
}

.vocab-drawer-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
}

.vocab-drawer-status {
  margin-top: 9px;
}

.vocab-drawer-visual {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-top: 15px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    radial-gradient(circle at 50% 5%, rgba(231, 173, 54, 0.14), transparent 10rem),
    var(--white);
  text-align: center;
}

.vocab-drawer-pictogram {
  display: grid;
  place-items: center;
}

.vocab-drawer-visual > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vocab-drawer-visual > strong {
  color: var(--teal-dark);
  font-size: 0.76rem;
}

.vocab-drawer-meaning,
.vocab-drawer-example,
.vocab-drawer-mastery {
  display: grid;
  gap: 5px;
  margin-top: 15px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.vocab-drawer-meaning > span,
.vocab-drawer-example > span,
.vocab-drawer-mastery > span {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vocab-drawer-meaning strong {
  color: var(--teal-dark);
  font-size: 1.08rem;
}

.vocab-drawer-audio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.vocab-drawer-example strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.vocab-drawer-example p {
  margin: 0;
  color: var(--teal-dark);
  font-size: 0.78rem;
}

.vocab-drawer-mastery > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.vocab-drawer-mastery button {
  min-height: 31px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.64rem;
  font-weight: 700;
}

.vocab-drawer-mastery button[aria-pressed="true"] {
  border-color: rgba(12, 113, 105, 0.22);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.vocab-drawer-links {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 7px;
  margin-top: 14px;
}

.vocab-drawer-tip {
  margin: 15px 0 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--gold-light);
  color: #6e4d16;
  font-size: 0.72rem;
  line-height: 1.6;
}

.language-focus-ai {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 750;
}

.language-focus-ai:hover {
  background: var(--teal);
}

.language-focus-ai:disabled {
  cursor: wait;
  opacity: 0.75;
}

.inline-ai-panel {
  margin: 0 0 28px;
  padding: 20px;
  border: 1px solid rgba(12, 113, 105, 0.18);
  border-radius: var(--radius-md);
  background: var(--teal-light);
}

.inline-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.inline-ai-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-ai-identity > div {
  display: flex;
  flex-direction: column;
}

.inline-ai-identity strong {
  font-size: 0.84rem;
}

.inline-ai-status {
  color: var(--teal-dark);
  font-size: 0.67rem;
}

.inline-ai-text {
  color: var(--ink);
  font-size: 0.91rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.ai-coach-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 4px 0 14px;
}

.ai-coach-action {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid rgba(12, 113, 105, 0.2);
  border-radius: 999px;
  background: rgba(255, 254, 251, 0.76);
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.69rem;
  font-weight: 750;
}

.ai-coach-action:hover {
  background: var(--white);
  border-color: var(--teal);
}

.ai-coach-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.ai-learning-summary {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid rgba(12, 113, 105, 0.13);
  border-radius: 13px;
  background: rgba(255, 254, 251, 0.72);
}

.ai-learning-summary > strong {
  display: block;
  margin-bottom: 7px;
  color: var(--teal-dark);
  font-size: 0.69rem;
}

.ai-summary-patterns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ai-summary-patterns span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--gold-light);
  color: var(--ink);
  font-size: 0.64rem;
  font-weight: 750;
}

.ai-summary-example-en,
.ai-summary-example-lao {
  margin: 8px 0 0;
  font-size: 0.74rem;
  line-height: 1.55;
}

.ai-summary-example-en {
  color: var(--ink);
  font-weight: 650;
}

.ai-summary-example-lao {
  color: var(--teal-dark);
}

.ai-coach-thread {
  display: flex;
  max-height: none;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
  padding: 3px 3px 5px;
}

.ai-coach-message {
  max-width: 90%;
  scroll-margin-top: calc(var(--reader-sticky-bottom, 220px) + 16px);
  padding: 11px 13px;
  border: 1px solid rgba(12, 113, 105, 0.11);
  border-radius: 15px;
  background: rgba(255, 254, 251, 0.94);
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.ai-coach-message[data-role="assistant"] {
  align-self: flex-start;
  border-top-left-radius: 4px;
}

.ai-coach-message[data-role="assistant"]::before {
  content: "Mai";
  display: block;
  margin-bottom: 4px;
  color: var(--teal-dark);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-coach-message.is-structured {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
}

.ai-coach-message.is-structured::before {
  display: none;
}

.ai-reply-section {
  padding: 10px 13px;
  border-bottom: 1px solid rgba(12, 113, 105, 0.09);
}

.ai-reply-section:last-child {
  border-bottom: 0;
}

.ai-reply-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ai-reply-body {
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.ai-reply-section.is-explanation .ai-reply-body {
  color: var(--ink);
}

.ai-reply-section.is-focus {
  background: rgba(217, 242, 235, 0.42);
}

.ai-reply-section.is-focus .ai-reply-body {
  color: var(--teal-dark);
  font-weight: 750;
}

.ai-reply-section.is-example-en {
  background: rgba(251, 248, 241, 0.82);
}

.ai-reply-section.is-example-en .ai-reply-body {
  color: var(--ink);
  font-weight: 650;
}

.ai-reply-section.is-question {
  background: rgba(248, 232, 185, 0.5);
}

.ai-reply-section.is-question .ai-reply-label {
  color: #805b17;
}

.ai-message-audio {
  display: flex;
  width: max-content;
  max-width: calc(100% - 26px);
  min-height: 34px;
  align-items: center;
  justify-content: center;
  margin: 10px 13px 12px auto;
  padding: 6px 11px;
  border: 1px solid rgba(12, 113, 105, 0.2);
  border-radius: 999px;
  background: var(--teal-light);
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.69rem;
  font-weight: 800;
}

.ai-message-audio:hover,
.ai-message-audio[data-playing="true"] {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.ai-coach-message[data-role="user"] {
  align-self: flex-end;
  border-color: transparent;
  border-bottom-right-radius: 4px;
  background: var(--ink);
  color: var(--white);
}

.ai-coach-message.is-loading {
  color: var(--muted);
  font-style: italic;
}

.ai-coach-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
}

.ai-coach-composer textarea {
  min-height: 54px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid rgba(12, 113, 105, 0.22);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  line-height: 1.5;
}

.ai-coach-composer textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 113, 105, 0.12);
}

.ai-coach-composer button {
  min-width: 72px;
  border: 0;
  border-radius: 11px;
  background: var(--teal);
  color: var(--white);
  cursor: pointer;
  font-weight: 800;
}

.ai-coach-composer button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.ai-coach-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 9px;
}

.ai-new-topic {
  min-height: 31px;
  padding: 5px 10px;
  border: 1px solid rgba(16, 47, 51, 0.13);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 700;
}

.ai-new-topic:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.ai-new-topic:disabled {
  cursor: wait;
  opacity: 0.55;
}

.inline-ai-panel .ai-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
}

.lesson-content tr.is-speaking td {
  background: var(--gold-light);
  color: var(--ink);
}

.lesson-content tr.is-speaking td:first-child {
  box-shadow: inset 4px 0 0 var(--gold);
}

.lesson-content tbody tr {
  scroll-margin-top: 250px;
}

.lesson-content p.is-speaking,
.lesson-content li.is-speaking {
  margin-left: -8px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--gold-light);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--gold);
}

.language-speed {
  min-width: 44px;
  justify-content: center;
}

.language-focus-subheading-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 20px 0 11px;
}

.language-focus-subheading-row > p {
  min-width: 220px;
  flex: 1 1 320px;
  margin: 0;
}

.language-focus-subheading-row > p strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.language-focus-subheading-row .vocabulary-listen {
  flex: 0 0 auto;
}

.language-focus-guide {
  margin: 0 0 28px;
  padding: 24px;
  border: 1px solid rgba(231, 173, 54, 0.38);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0, rgba(231, 173, 54, 0.16), transparent 18rem),
    #fffaf0;
  box-shadow: 0 10px 28px rgba(98, 72, 21, 0.07);
}

.guide-heading {
  margin-bottom: 16px;
}

.guide-kicker {
  display: inline-flex;
  margin-bottom: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--gold-light);
  color: #8b5c15;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.language-focus-guide h4 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1.4;
}

.guide-summary {
  max-width: 66ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.8;
}

.guide-quick-rule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid rgba(12, 113, 105, 0.14);
  border-radius: 11px;
  background: var(--teal-light);
}

.guide-quick-rule > span {
  color: var(--teal-dark);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.guide-quick-rule strong {
  color: var(--ink);
  font-size: 0.83rem;
  line-height: 1.6;
}

.guide-study-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin: 0 0 14px;
  padding: 11px 12px;
  border: 1px solid rgba(12, 113, 105, 0.12);
  border-radius: 11px;
  background: rgba(255, 254, 251, 0.78);
}

.guide-study-progress {
  display: grid;
  gap: 6px;
}

.guide-study-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guide-study-progress strong {
  color: var(--ink);
  font-size: 0.7rem;
}

.guide-study-count {
  color: var(--teal-dark);
  font-size: 0.63rem;
  font-weight: 750;
}

.guide-study-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(12, 113, 105, 0.12);
}

.guide-study-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 220ms ease;
}

.guide-study-views {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: var(--paper);
}

.guide-study-views button {
  min-height: 29px;
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.63rem;
  font-weight: 750;
}

.guide-study-views button.is-active {
  background: var(--teal);
  color: var(--white);
}

.guide-pattern-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 1px 8px;
}

.guide-pattern-caption strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.guide-pattern-caption span {
  color: var(--muted);
  font-size: 0.62rem;
  text-align: right;
}

.guide-patterns {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.guide-pattern {
  display: grid;
  grid-template-columns: 30px minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid rgba(16, 47, 51, 0.08);
  border-radius: 11px;
  background: var(--white);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.guide-pattern:hover {
  border-color: rgba(12, 113, 105, 0.2);
  box-shadow: 0 7px 18px rgba(33, 58, 55, 0.055);
}

.guide-pattern.is-understood {
  border-color: rgba(12, 113, 105, 0.28);
  background: rgba(232, 247, 242, 0.66);
}

.guide-pattern [hidden] {
  display: none !important;
}

.guide-pattern-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: #8b5c15;
  font-size: 0.62rem;
  font-weight: 850;
}

.guide-pattern-usage,
.guide-pattern-example,
.guide-pattern-contrast {
  grid-column: 2 / -1;
}

.guide-pattern-usage {
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: rgba(241, 234, 220, 0.5);
}

.guide-pattern-usage p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.65;
}

.guide-pattern-example {
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid rgba(12, 113, 105, 0.12);
  border-radius: 8px;
  background: var(--teal-light);
}

.guide-pattern-example strong {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.55;
}

.guide-pattern-controls {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 3px;
}

.guide-pattern-controls button {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.63rem;
  font-weight: 700;
}

.guide-pattern-controls button:hover {
  border-color: rgba(12, 113, 105, 0.2);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.guide-pattern-controls button[data-playing="true"] {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.guide-pattern-mastery.is-active {
  border-color: rgba(12, 113, 105, 0.23);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.guide-pattern-example-lao {
  color: var(--teal-dark);
  font-size: 0.75rem;
  line-height: 1.55;
}

.guide-pattern-contrast {
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff1ed;
  color: #8a3828;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.55;
}

.guide-pattern-form,
.guide-pattern-meaning {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.guide-pattern-label {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.guide-pattern code {
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: normal;
}

.guide-pattern-meaning > span:last-child {
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.55;
  text-align: right;
}

.guide-example {
  padding: 15px 16px;
  border: 1px solid rgba(12, 113, 105, 0.12);
  border-radius: 12px;
  background: var(--teal-light);
}

.guide-example-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.guide-example-heading strong {
  color: var(--teal-dark);
  font-size: 0.72rem;
}

.guide-example-heading span {
  color: var(--teal-dark);
  font-size: 0.59rem;
  font-weight: 750;
}

.guide-example-en {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
}

.guide-example-lao {
  margin: 0;
  padding-top: 7px;
  border-top: 1px solid rgba(12, 113, 105, 0.12);
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.guide-mistakes {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(231, 173, 54, 0.34);
  border-radius: 11px;
  background: rgba(255, 254, 251, 0.78);
}

.guide-mistakes > strong {
  color: #805b17;
  font-size: 0.72rem;
}

.guide-mistakes ul {
  margin: 7px 0 0;
  padding-left: 1.15rem;
}

.guide-mistakes li {
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.6;
}

.guide-mistakes li:last-child {
  margin-bottom: 0;
}

.guide-remember {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(241, 234, 220, 0.5);
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.7;
}

.lesson-sidebar {
  display: grid;
  gap: 15px;
  position: sticky;
  top: 20px;
}

.sidebar-card {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--white);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.sidebar-card:hover {
  border-color: rgba(12, 113, 105, 0.2);
  box-shadow: var(--shadow-small);
}

.sidebar-card .eyebrow {
  margin-bottom: 16px;
}

.goal-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.goal-list li {
  position: relative;
  padding: 10px 0 10px 24px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.goal-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.goal-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.sidebar-goal-english {
  display: block;
}

.sidebar-goal-lao {
  display: block;
  margin-top: 3px;
  color: var(--teal-dark);
  font-size: 0.76rem;
  line-height: 1.55;
}

.chip-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--teal-light);
  color: var(--teal-dark);
}

.chip strong {
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 750;
}

.chip small {
  color: var(--ink-soft);
  font-size: 0.64rem;
  font-weight: 550;
  line-height: 1.45;
}

.sidebar-note {
  margin: 17px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-pronunciation-lao,
.sidebar-pronunciation-english {
  display: block;
}

.sidebar-pronunciation-lao {
  margin-top: 3px;
  color: var(--teal-dark);
  font-weight: 650;
}

.sidebar-pronunciation-english {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.sidebar-cta {
  background: var(--ink);
  color: var(--white);
}

.sidebar-cta p {
  color: rgba(255, 254, 251, 0.65);
  font-size: 0.76rem;
  margin-bottom: 3px;
}

.sidebar-cta strong {
  display: block;
  margin-bottom: 18px;
}

.sidebar-cta .button-full {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
}

.sidebar-cta .text-link {
  display: block;
  margin-top: 14px;
  color: var(--gold-light);
  text-align: center;
  font-size: 0.78rem;
}

.manual-practice {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 2px solid var(--ink);
}

.manual-card {
  margin-top: 12px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--paper);
}

.manual-card > span {
  color: var(--coral-dark);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.manual-card h3 {
  margin: 10px 0;
  color: var(--ink);
  font-size: 1.16rem;
}

.manual-card p {
  margin-bottom: 0;
  font-size: 0.85rem;
}

/* AI tutor */
.tutor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  padding: 22px 0 18px;
}

.tutor-header h1 {
  margin-bottom: 7px;
  font-size: clamp(2rem, 3.2vw, 3rem);
}

.tutor-header-copy {
  max-width: 780px;
}

.tutor-header-copy > p:not(.eyebrow) {
  max-width: 760px;
  margin-bottom: 10px;
  color: var(--ink-soft);
}

.tutor-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tutor-benefits span {
  padding: 5px 9px;
  border: 1px solid rgba(12, 113, 105, 0.12);
  border-radius: 999px;
  background: rgba(220, 241, 235, 0.65);
  color: var(--teal-dark);
  font-size: 0.68rem;
  font-weight: 700;
}

.tutor-header-actions {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.tutor-live-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 750;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #27a67d;
  box-shadow: 0 0 0 4px rgba(39, 166, 125, 0.12);
}

.tutor-live-state.is-offline {
  color: var(--muted);
}

.tutor-live-state.is-offline .status-dot {
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(95, 111, 109, 0.1);
}

.ai-warning {
  display: flex;
  gap: 8px;
  flex-direction: column;
  margin-bottom: 18px;
  padding: 17px 20px;
  border: 1px solid rgba(128, 83, 18, 0.2);
  border-radius: var(--radius-md);
  background: var(--gold-light);
  color: #694810;
  font-size: 0.84rem;
}

.ai-warning strong {
  font-size: 0.95rem;
}

.ai-warning code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
}

.tutor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
  padding-bottom: 55px;
}

.chat-panel {
  height: clamp(520px, calc(100vh - 330px), 680px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: 0 18px 45px rgba(33, 58, 55, 0.08);
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.ai-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ai-avatar {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--gold);
}

.ai-identity > div {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.ai-identity strong {
  font-size: 0.88rem;
}

.ai-identity span {
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 650;
}

.chat-unit {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 650;
}

.chat-room-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-reset {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.69rem;
  font-weight: 750;
}

.chat-reset:hover {
  border-color: rgba(217, 84, 60, 0.35);
  background: #fff1ed;
  color: #8a3828;
}

.chat-reset:disabled {
  cursor: wait;
  opacity: 0.55;
}

.chat-log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 254, 251, 0.92), rgba(255, 254, 251, 0.92)),
    radial-gradient(circle at 18% 10%, var(--teal-light), transparent 20rem);
  scroll-behavior: smooth;
}

.chat-welcome {
  width: min(100%, 570px);
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  padding: 24px;
  text-align: center;
}

.chat-welcome-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 850;
  box-shadow: 5px 5px 0 var(--gold);
}

.chat-welcome-kicker {
  margin: 0 0 6px !important;
  color: var(--teal) !important;
  font-size: 0.64rem !important;
  font-weight: 850;
  letter-spacing: 0.11em;
}

.chat-welcome h2 {
  margin: 0 0 9px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.25;
}

.chat-welcome > p:not(.chat-welcome-kicker) {
  max-width: 500px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.7;
}

.chat-welcome-skills {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.chat-welcome-skills span {
  display: grid;
  gap: 5px;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 650;
  text-align: left;
}

.chat-welcome-skills strong {
  color: var(--gold);
  font-size: 0.61rem;
  letter-spacing: 0.08em;
}

.chat-message {
  max-width: 86%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 18px;
}

.chat-message.user {
  align-items: flex-end;
  margin-left: auto;
}

.chat-name {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.message-bubble {
  padding: 13px 16px;
  border-radius: 4px 16px 16px 16px;
  border: 1px solid rgba(12, 113, 105, 0.08);
  background: #edf8f4;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.72;
  white-space: pre-wrap;
  box-shadow: 0 5px 14px rgba(33, 58, 55, 0.045);
}

.chat-message.user .message-bubble {
  border-radius: 16px 4px 16px 16px;
  background: var(--ink);
  color: var(--white);
}

.chat-message.chat-error .message-bubble {
  background: #ffe6de;
  color: #8e3826;
}

.chat-message.thinking .message-bubble {
  color: var(--muted);
  font-style: italic;
}

.chat-message.thinking .message-bubble::after {
  content: "•••";
  display: inline-block;
  margin-left: 5px;
  letter-spacing: 0.1em;
  animation: tutorThinking 1.1s ease-in-out infinite;
}

@keyframes tutorThinking {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.speak-message {
  margin-top: 2px;
  padding: 5px 9px;
  border: 1px solid rgba(12, 113, 105, 0.15);
  border-radius: 999px;
  background: var(--white);
  color: var(--teal);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 750;
}

.speak-message:hover {
  background: var(--teal-light);
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.72);
}

.quick-prompts-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.writing-review-notice {
  margin: 0 20px;
  padding: 10px 12px;
  border: 1px solid rgba(231, 173, 54, 0.32);
  border-radius: 10px;
  background: var(--gold-light);
  color: #6f4c10;
  font-size: 0.68rem;
  line-height: 1.6;
}

.quick-prompts button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 650;
}

.quick-prompts button:hover {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.quick-prompts button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tutor-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 20px 0;
}

.tutor-form textarea {
  width: 100%;
  min-height: 62px;
  max-height: 150px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  resize: vertical;
}

.tutor-form textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 113, 105, 0.12);
}

.tutor-form textarea:disabled {
  opacity: 0.55;
}

.tutor-form .button {
  min-width: 92px;
  min-height: 62px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 14px;
}

.tutor-form .button kbd {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  color: inherit;
  font-family: inherit;
  font-size: 0.56rem;
  font-weight: 650;
  opacity: 0.8;
}

.tutor-form .button.is-loading kbd {
  display: none;
}

.tutor-form .button.is-loading::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: tutorSpin 700ms linear infinite;
}

@keyframes tutorSpin {
  to {
    transform: rotate(360deg);
  }
}

.tutor-compose-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 21px 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.tutor-compose-meta #tutor-char-count {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.tutor-compose-meta #tutor-char-count.is-near-limit {
  color: var(--coral);
  font-weight: 800;
}

.chat-disclaimer {
  margin: 0;
  padding: 7px 20px 14px;
  color: var(--muted);
  font-size: 0.66rem;
}

.tutor-side {
  display: grid;
  gap: 14px;
}

.tutor-prompt-list {
  display: grid;
  gap: 7px;
}

.tutor-prompt-list button {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

.tutor-prompt-list button:hover {
  border-color: rgba(12, 113, 105, 0.28);
  background: var(--teal-light);
  transform: translateY(-1px);
}

.tutor-prompt-list button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.tutor-prompt-list strong {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-light);
  color: #785119;
  font-size: 0.57rem;
}

.tutor-prompt-list span {
  font-size: 0.73rem;
  font-weight: 650;
  line-height: 1.45;
}

.ai-safety-note {
  padding: 18px;
  border: 1px dashed rgba(16, 47, 51, 0.25);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

/* Quiz */
.quiz-header {
  max-width: 850px;
  padding: 45px 0 42px;
}

.quiz-header h1 {
  margin-bottom: 16px;
  font-size: clamp(2.5rem, 5vw, 4.6rem);
}

.quiz-header > p:last-child {
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.quiz-form {
  max-width: 900px;
  padding-bottom: 80px;
}

.question-card {
  margin: 0 0 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.question-card legend {
  width: 100%;
  padding: 0;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 720;
  line-height: 1.45;
}

.question-count {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: 0.7rem;
}

.question-skill {
  display: inline-block;
  margin-right: 9px;
  color: var(--coral-dark);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-placeholder {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 18px 0 5px;
  padding: 10px 13px;
  border-radius: 9px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.75rem;
}

.play-dot {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 800;
}

.option-list {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.answer-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: border-color 140ms ease, background 140ms ease;
}

.answer-option:hover {
  border-color: rgba(12, 113, 105, 0.38);
  background: var(--teal-light);
}

.answer-option:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--ink);
  font-weight: 650;
}

.answer-option input {
  accent-color: var(--teal);
  width: 17px;
  height: 17px;
}

.answer-label {
  display: block;
  margin: 22px 0 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.answer-input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

.answer-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 113, 105, 0.12);
}

.quiz-submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--gold-light);
}

.quiz-submit p {
  margin: 3px 0 0;
  color: #73501b;
  font-size: 0.8rem;
}

/* Result */
.result-header {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 40px;
  align-items: center;
  margin-top: 35px;
  padding: 48px;
  border-radius: var(--radius-xl);
}

.result-pass {
  background: var(--teal-light);
}

.result-retry {
  background: #ffe5dc;
}

.result-header h1 {
  margin-bottom: 15px;
  font-size: clamp(2.5rem, 5vw, 4.3rem);
}

.result-header p {
  color: var(--ink-soft);
}

.result-score {
  width: 170px;
  height: 170px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-small);
}

.result-score strong {
  font-size: 2.8rem;
  line-height: 1;
  letter-spacing: -0.08em;
}

.result-score span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 7px;
}

.review-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.review-card {
  position: relative;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--white);
}

.review-card.review-correct {
  border-top: 4px solid var(--teal);
}

.review-card.review-wrong {
  border-top: 4px solid var(--coral);
}

.review-status {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-card h3 {
  margin: 13px 0 18px;
  font-size: 1.1rem;
  line-height: 1.45;
}

.review-answer {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.review-answer span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.review-correct-answer {
  color: var(--teal-dark);
}

.review-explanation {
  margin: 15px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.83rem;
}

/* Auth */
.auth-layout {
  min-height: calc(100vh - 210px);
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(40px, 8vw, 110px);
  align-items: center;
  padding: 70px 0;
}

.auth-intro h1 {
  max-width: 650px;
  margin-bottom: 24px;
  font-size: clamp(2.8rem, 5vw, 5rem);
}

.auth-intro > p:not(.eyebrow) {
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.auth-quote {
  max-width: 430px;
  margin-top: 40px;
  padding: 20px 22px;
  border-left: 4px solid var(--gold);
  color: var(--teal-dark);
  font-size: 1.05rem;
  font-weight: 650;
}

.auth-benefits {
  padding: 0;
  margin: 28px 0 0;
  list-style: none;
}

.auth-benefits li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  color: var(--ink-soft);
}

.auth-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--teal);
  font-weight: 900;
}

.auth-card {
  width: min(100%, 470px);
  justify-self: end;
  padding: 38px;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.auth-card-wide {
  width: min(100%, 550px);
}

.auth-card h2 {
  margin-bottom: 8px;
  font-size: 2.1rem;
}

.stack-form {
  margin-top: 26px;
}

.form-group {
  margin-bottom: 17px;
}

.form-group > label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 720;
}

.form-group input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

.form-group input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 113, 105, 0.12);
}

.help-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.5;
}

.help-text ul {
  padding-left: 16px;
  margin: 4px 0;
}

.form-error,
.field-error {
  color: #a43725;
  font-size: 0.75rem;
}

.form-error {
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #ffebe5;
}

.form-error ul,
.field-error ul {
  margin: 0;
  padding-left: 16px;
}

.auth-switch {
  margin: 22px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-switch a {
  color: var(--teal);
  font-weight: 750;
}

.dictionary-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 68px 0 42px;
}

.dictionary-hero h1 {
  margin-bottom: 16px;
  font-size: clamp(2.8rem, 6vw, 5.3rem);
}

.dictionary-hero > div > p:last-child {
  max-width: 720px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.dictionary-count {
  flex: 0 0 160px;
  min-height: 140px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 24px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-small);
}

.dictionary-count strong {
  color: var(--gold);
  font-size: 2.6rem;
  line-height: 1;
}

.dictionary-count span {
  margin-top: 8px;
  color: rgba(255, 254, 251, 0.65);
  font-size: 0.72rem;
}

.dictionary-shell {
  padding-bottom: 80px;
}

.dictionary-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow-small);
}

.dictionary-search input {
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  font-size: 1rem;
}

.dictionary-search select {
  min-width: 0;
  min-height: 52px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  color: var(--ink-soft);
  outline: none;
  font-size: 0.82rem;
}

.vocabulary-dictionary-link {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--teal-dark);
  font-size: 0.69rem;
  font-weight: 750;
}

.vocabulary-dictionary-link:hover {
  border-color: var(--teal);
  background: var(--teal-light);
}

.dictionary-search input:focus {
  box-shadow: 0 0 0 3px rgba(12, 113, 105, 0.14);
}

.dictionary-filters {
  display: flex;
  gap: 8px;
  margin: 18px 0 24px;
}

.dictionary-filters a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.dictionary-filters a.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.dictionary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dictionary-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  transition: transform 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease;
}

.dictionary-card:hover {
  transform: translateY(-3px);
  border-color: rgba(12, 113, 105, 0.23);
  box-shadow: var(--shadow-small);
}

.dictionary-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dictionary-unit,
.dictionary-pos {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--gold-light);
  color: #785119;
  font-size: 0.64rem;
  font-weight: 750;
}

.dictionary-pos {
  background: var(--teal-light);
  color: var(--teal-dark);
  font-style: italic;
}

.dictionary-card h2 {
  margin: 24px 0 6px;
  font-size: 1.8rem;
}

.dictionary-word-row {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 20px;
}

.dictionary-word-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  margin-top: 18px;
  border-radius: 14px;
}

.vocab-pictogram.vocab-photo {
  width: 96px;
  height: 64px;
  overflow: hidden;
}

.vocab-pictogram.vocab-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vocab-photo.vocab-pictogram-flashcard,
.vocab-photo.vocab-pictogram-detail {
  width: min(240px, 100%);
  height: auto;
  aspect-ratio: 3 / 2;
}

.dictionary-popover-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  margin-top: 12px;
  border-radius: 12px;
}

.dictionary-word-row > div {
  min-width: 0;
}

.dictionary-word-row h2 {
  margin: 0 0 4px;
  font-size: 1.8rem;
}

.dictionary-word-visual {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(12, 113, 105, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.95), transparent 42%),
    linear-gradient(145deg, #edf8f4, #fff7e8);
  color: var(--teal-dark);
  box-shadow: 0 8px 18px rgba(12, 113, 105, 0.08);
}

.dictionary-word-visual svg {
  width: 72%;
  height: 72%;
}

.dictionary-ipa {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.dictionary-lao {
  color: var(--teal-dark);
  font-size: 1rem;
  font-weight: 650;
}

.dictionary-example {
  flex: 1;
  color: var(--muted);
  font-size: 0.84rem;
}

.dictionary-example-block {
  flex: 1;
}

.dictionary-example-lao {
  margin-top: 5px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1.55;
}

.dictionary-actions,
.dictionary-popover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dictionary-action,
.dictionary-popover-actions button,
.dictionary-popover-actions a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
}

.dictionary-action:hover,
.dictionary-popover-actions > *:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.dictionary-action.is-saved,
.dictionary-popover-actions .is-saved {
  border-color: rgba(12, 113, 105, 0.2);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.dictionary-ai {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.dictionary-ai:hover {
  background: var(--teal);
  color: var(--white);
}

.dictionary-empty {
  margin-top: 30px;
}

.dictionary-word {
  display: inline;
  padding: 0 1px;
  border: 0;
  border-bottom: 1px dotted rgba(12, 113, 105, 0.5);
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: help;
}

.dictionary-word:hover,
.dictionary-word:focus-visible {
  border-radius: 3px;
  background: var(--teal-light);
  color: var(--teal-dark);
}

.dictionary-popover {
  position: fixed;
  z-index: 1200;
  padding: 18px;
  border: 1px solid rgba(16, 47, 51, 0.14);
  border-radius: 16px;
  background: rgba(255, 254, 251, 0.98);
  box-shadow: 0 22px 60px rgba(16, 47, 51, 0.24);
  backdrop-filter: blur(18px);
}

.dictionary-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dictionary-popover-header strong {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.dictionary-popover-header span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--gold-light);
  color: #785119;
  font-size: 0.63rem;
  font-weight: 750;
}

.dictionary-popover-visual {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 12px auto 0;
  border: 1px solid rgba(12, 113, 105, 0.16);
  border-radius: 19px;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.95), transparent 42%),
    linear-gradient(145deg, #edf8f4, #fff7e8);
  color: var(--teal-dark);
  box-shadow: 0 8px 18px rgba(12, 113, 105, 0.08);
}

.dictionary-popover-visual svg {
  width: 72%;
  height: 72%;
}

.dictionary-popover-lao {
  margin: 12px 0 8px;
  color: var(--teal-dark);
  font-size: 1rem;
  font-weight: 650;
}

.dictionary-popover-example {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dictionary-popover-example-lao {
  margin: -8px 0 14px;
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 550;
  line-height: 1.55;
}

.dictionary-alternatives {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.dictionary-alternatives button {
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 700;
}

.dictionary-loading {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.reader-controls button.is-active {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 45;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(16, 47, 51, 0.15);
  border-radius: 50%;
  background: rgba(255, 254, 251, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow-small);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(12px);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lesson-mobile-dock {
  display: none;
}

.daily-plan {
  margin-top: 22px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-small);
}

.daily-plan-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.daily-plan-heading h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
}

.daily-plan-unit {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--gold-light);
  color: #765018;
  font-size: 0.7rem;
  font-weight: 800;
}

.daily-plan-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.daily-plan-steps > a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  transition: transform 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease;
}

.daily-plan-steps > a:hover {
  transform: translateY(-2px);
  border-color: rgba(12, 113, 105, 0.25);
  box-shadow: var(--shadow-small);
}

.plan-step-number {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  font-size: 0.73rem;
  font-weight: 800;
}

.daily-plan-steps strong {
  display: block;
  font-size: 0.9rem;
}

.daily-plan-steps small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

body.reader-focus-mode {
  background: var(--paper);
}

body.reader-focus-mode .site-header,
body.reader-focus-mode .site-footer,
body.reader-focus-mode .breadcrumb,
body.reader-focus-mode .lesson-sidebar,
body.reader-focus-mode .lesson-mobile-dock,
body.reader-focus-mode .back-to-top {
  display: none;
}

body.reader-focus-mode .site-shell {
  width: min(100% - 44px, 980px);
}

body.reader-focus-mode .lesson-hero {
  padding: 34px 0 28px;
}

body.reader-focus-mode .lesson-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.4rem);
}

body.reader-focus-mode .lesson-layout {
  display: block;
  padding-bottom: 70px;
}

body.reader-focus-mode .lesson-content {
  padding: 48px;
  border-color: transparent;
  box-shadow: 0 24px 70px rgba(33, 58, 55, 0.13);
}

body.reader-focus-mode .reader-toolbar {
  top: 10px;
  margin: -48px -48px 36px;
}

@media (max-width: 1180px) {
  .speaking-studio {
    grid-template-columns: minmax(0, 1fr);
  }
  .reader-toolbar {
    grid-template-columns: 1fr;
  }

  .reader-controls {
    justify-content: flex-end;
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 1050px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 55px;
  }

  .hero-copy {
    max-width: 850px;
  }

  .hero-visual {
    min-height: 470px;
  }

  .unit-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .reader-toolbar {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar {
    position: static;
    grid-template-columns: repeat(3, 1fr);
  }

  .tutor-layout {
    grid-template-columns: 1fr;
  }

  .tutor-side {
    grid-template-columns: 1fr 1fr;
  }

  .dictionary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-shell {
    width: min(100% - 26px, 1280px);
  }

  .site-header {
    min-height: 80px;
  }

  body:has(.lesson-mobile-dock) {
    padding-bottom: 84px;
  }

  .lesson-mobile-dock {
    position: fixed;
    right: 13px;
    bottom: 12px;
    left: 13px;
    z-index: 42;
    display: flex;
    gap: 9px;
    padding: 9px;
    border: 1px solid rgba(16, 47, 51, 0.13);
    border-radius: 18px;
    background: rgba(255, 254, 251, 0.94);
    box-shadow: 0 12px 36px rgba(33, 58, 55, 0.18);
    backdrop-filter: blur(16px);
  }

  .lesson-mobile-dock a {
    min-height: 46px;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 750;
  }

  .lesson-mobile-dock a > span {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--teal);
    color: var(--white);
    font-size: 0.68rem;
  }

  .lesson-mobile-dock .dock-primary {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--white);
  }

  .brand-copy {
    display: none;
  }

  .main-nav {
    gap: 14px;
  }

  .hero {
    min-height: auto;
    padding: 45px 0 65px;
  }

  .hero-copy h1 span {
    white-space: normal;
  }

  .feature-grid,
  .preview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .feature-card.feature-accent {
    transform: none;
  }

  .feature-number {
    margin-bottom: 52px;
  }

  .section-heading-row,
  .cta-band {
    align-items: start;
    flex-direction: column;
  }

  .resume-card {
    grid-template-columns: 80px 1fr;
  }

  .resume-number {
    width: 72px;
    height: 72px;
    font-size: 1.55rem;
  }

  .resume-card .button {
    grid-column: 1 / -1;
  }

  .daily-plan-steps {
    grid-template-columns: 1fr;
  }

  .unit-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lesson-hero {
    align-items: start;
    flex-direction: column;
  }

  .reader-toolbar {
    top: 80px;
  }

  .reader-controls {
    justify-content: flex-end;
  }

  .tutor-header {
    align-items: start;
    flex-direction: column;
  }

  .dictionary-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .dictionary-count {
    flex: none;
    min-height: 110px;
    padding: 15px;
  }

  .lesson-sidebar {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    padding: 45px 0;
  }

  .auth-card {
    justify-self: start;
  }

  .review-list {
    grid-template-columns: 1fr;
  }

  .result-header {
    grid-template-columns: 1fr;
  }

  .dictionary-search {
    grid-template-columns: 1fr;
  }

  .dictionary-grid {
    grid-template-columns: 1fr;
  }

  .result-score {
    width: 140px;
    height: 140px;
  }

  .tutor-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .lesson-content .vocabulary-table {
    display: block;
    overflow: visible;
    border-collapse: separate;
  }

  .vocabulary-table thead {
    display: none;
  }

  .vocabulary-table tbody {
    display: grid;
    gap: 10px;
  }

  .vocabulary-table tbody tr,
  .vocabulary-table tbody tr:nth-child(even) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 7px 20px rgba(33, 58, 55, 0.06);
  }

  .vocabulary-table tbody td {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 0.82rem;
  }

  .vocabulary-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .vocabulary-table tbody td:nth-child(1) {
    grid-column: 1;
    color: var(--ink);
    font-size: 1.02rem;
    font-weight: 800;
  }

  .vocabulary-table tbody td:nth-child(2) {
    grid-column: 2;
    color: var(--teal-dark);
    font-weight: 700;
    text-align: right;
  }

  .vocabulary-table tbody td:nth-child(3) {
    grid-column: 1 / -1;
    margin-top: 2px;
    padding: 10px 11px;
    border-radius: 9px;
    background: rgba(251, 248, 241, 0.75);
  }

  .vocabulary-table tbody tr.is-speaking,
  .vocabulary-table tbody tr.is-speaking td {
    background: var(--gold-light);
    color: var(--ink);
  }

  .vocabulary-table tbody tr.is-speaking {
    border-color: rgba(231, 173, 54, 0.65);
    box-shadow: 0 9px 24px rgba(175, 124, 24, 0.16);
  }

  .vocabulary-table tbody tr.is-speaking td:first-child {
    box-shadow: none;
  }

  .vocabulary-table .vocabulary-example-lao {
    color: var(--ink-soft);
    font-size: 0.76rem;
  }

  .vocab-study-tools {
    grid-template-columns: 1fr;
  }

  .vocab-study-summary {
    grid-template-columns: 1fr auto;
  }

  .vocab-summary-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .vocab-filter-pills {
    padding-bottom: 1px;
  }

  .vocab-result-count {
    text-align: left;
  }

  .vocab-mode-panel {
    padding: 16px;
  }

  .vocab-flashcard-stage {
    min-height: 320px;
  }

  .vocab-flashcard {
    min-height: 300px;
  }

  .vocab-pictogram-flashcard {
    width: 78px;
    height: 78px;
    border-radius: 21px;
  }

  .vocab-practice-options {
    grid-template-columns: 1fr;
  }

  .vocab-review-item {
    grid-template-columns: 1fr;
  }

  .vocab-review-item > div:last-child {
    flex-wrap: wrap;
  }

  .vocab-drawer-panel {
    width: min(420px, 96vw);
    padding: 21px;
  }

  .pronunciation-study-progress > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .pronunciation-study-steps {
    align-items: stretch;
  }

  .pronunciation-next {
    width: 100%;
    margin-left: 0;
  }

  .speaking-studio {
    grid-template-columns: 1fr;
  }

  .writing-studio-grid {
    grid-template-columns: 1fr;
  }

  .writing-studio-header {
    flex-direction: column;
    gap: 7px;
  }

  .dialogue-coach-header {
    flex-direction: column;
    gap: 9px;
  }

  .dialogue-coach-tabs {
    width: 100%;
  }

  .dialogue-coach-header-actions {
    width: 100%;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .dialogue-coach-tabs button {
    flex: 1;
  }

  .lesson-content blockquote p {
    padding-left: 44px;
  }

  .lesson-content blockquote p::before {
    width: 28px;
    height: 28px;
    left: 7px;
  }

  .dialogue-coach-controls .button {
    flex: 1 1 auto;
  }

  .tutor-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 24px 0 20px;
  }

  .tutor-header-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .chat-panel {
    height: min(680px, calc(100dvh - 140px));
    min-height: 520px;
  }

  .chat-welcome {
    padding: 18px 10px;
  }

  .chat-welcome-skills {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  body {
    font-size: 15px;
  }

  .language-focus-guide {
    padding: 18px;
    border-radius: var(--radius-md);
  }

  .guide-study-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .guide-study-views {
    width: 100%;
  }

  .guide-study-views button {
    flex: 1;
  }

  .speaking-starter-list {
    grid-template-columns: 1fr;
  }

  .language-focus-subheading-row > p {
    min-width: 0;
    flex-basis: 100%;
  }

  .guide-quick-rule {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .guide-pattern-caption span {
    display: none;
  }

  .guide-pattern {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
  }

  .guide-pattern-number {
    grid-row: 1 / span 2;
  }

  .guide-pattern-meaning {
    grid-column: 2;
    padding-top: 4px;
    border-top: 1px solid var(--line);
  }

  .guide-pattern-meaning > span:last-child {
    text-align: left;
  }

  .inline-ai-header {
    flex-wrap: wrap;
  }

  .inline-ai-header .vocabulary-listen {
    width: 100%;
    justify-content: center;
  }

  .ai-coach-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ai-coach-action {
    min-height: 38px;
    justify-content: center;
    white-space: normal;
  }

  .ai-coach-message {
    max-width: 100%;
  }

  .ai-coach-composer {
    grid-template-columns: 1fr;
  }

  .ai-coach-composer button {
    min-height: 42px;
  }

  .ai-message-audio {
    width: calc(100% - 26px);
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .main-nav > a:not(.button) {
    display: none;
  }

  .main-nav > .nav-dictionary-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--ink-soft);
    font-size: 0.76rem;
  }

  .hero-copy h1 {
    font-size: 2.75rem;
  }

  .hero-lead {
    font-size: 1.02rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
  }

  .trust-row {
    gap: 14px;
  }

  .hero-visual {
    min-height: 420px;
  }

  .scene-card {
    padding: 20px;
  }

  .floating-note {
    display: none;
  }

  .feature-grid,
  .preview-grid,
  .unit-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .section-block {
    padding: 62px 0;
  }

  .cta-band {
    padding: 32px 25px;
  }

  .site-footer {
    flex-direction: column;
  }

  .footer-note {
    text-align: left;
  }

  .dashboard-header {
    align-items: start;
    flex-direction: column;
    padding-top: 45px;
  }

  .daily-plan {
    padding: 20px 16px;
  }

  .daily-plan-heading {
    flex-direction: column;
    gap: 10px;
  }

  .score-ring {
    width: 110px;
    height: 110px;
    flex-basis: 110px;
  }

  .resume-card {
    grid-template-columns: 1fr;
    padding: 25px;
  }

  .resume-number {
    width: 62px;
    height: 62px;
    font-size: 1.35rem;
  }

  .resume-card .button {
    grid-column: auto;
    width: 100%;
  }

  .attempt-row {
    grid-template-columns: 1fr auto;
    gap: 6px 14px;
  }

  .attempt-row > span:nth-child(3) {
    grid-column: 1 / 2;
  }

  .attempt-score {
    grid-row: 1 / 3;
    grid-column: 2;
    align-self: center;
  }

  .lesson-hero .button {
    width: 100%;
  }

  .lesson-actions {
    width: 100%;
    flex-direction: column;
  }

  .lesson-actions .button {
    width: 100%;
  }

  .lesson-audio-bar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .lesson-audio-actions {
    align-items: stretch;
    grid-column: 1;
    grid-row: auto;
  }

  .lesson-audio-actions .button-small {
    flex: 1;
  }

  .speech-status {
    text-align: left;
  }

  .lesson-content {
    padding: 23px 18px;
    border-radius: var(--radius-lg);
  }

  .reader-toolbar {
    top: 80px;
    margin: -23px -18px 24px;
    padding: 10px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .reader-toc-group {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .reader-toc {
    width: 100%;
  }

  .reader-controls {
    justify-content: flex-end;
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .reader-toc button {
    min-height: 28px;
  }

  body.reader-focus-mode .site-shell {
    width: min(100% - 20px, 980px);
  }

  body.reader-focus-mode .lesson-content {
    padding: 24px 17px;
  }

  body.reader-focus-mode .reader-toolbar {
    margin: -24px -17px 26px;
  }

  .back-to-top {
    right: 18px;
    bottom: 82px;
  }

  .lesson-content h2 {
    font-size: 1.65rem;
  }

  .lesson-content h3 {
    font-size: 1.26rem;
  }

  .question-card {
    padding: 21px 17px;
  }

  .chat-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-room-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-log {
    padding: 22px 15px;
  }

  .chat-message {
    max-width: 94%;
  }

  .quick-prompts,
  .tutor-form {
    padding-left: 14px;
    padding-right: 14px;
  }

  .tutor-form {
    grid-template-columns: 1fr;
  }

  .tutor-form .button {
    width: 100%;
    min-height: 48px;
    flex-direction: row;
  }

  .tutor-form .button kbd {
    display: none;
  }

  .tutor-compose-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .chat-disclaimer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .vocab-mode-heading {
    flex-direction: column;
    gap: 7px;
  }

  .vocab-flashcard-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .vocab-flashcard-controls [data-flash-reveal] {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .vocab-mastery-actions {
    align-items: stretch;
  }

  .vocab-mastery-actions > span {
    flex-basis: 100%;
  }

  .vocab-drawer-links,
  .vocab-drawer-audio {
    grid-template-columns: 1fr;
  }

  .inline-ai-header {
    align-items: stretch;
    flex-direction: column;
  }

  .question-card legend {
    font-size: 1rem;
  }

  .quiz-submit {
    align-items: stretch;
    flex-direction: column;
  }

  .result-header {
    padding: 30px 24px;
  }

  .auth-card {
    padding: 28px 21px;
  }

  .auth-intro h1 {
    font-size: 2.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
