.lesson-card {
  display: flex;
  flex-direction: column;
}

.lesson-eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  text-align: center;
  margin-bottom: 6px;
  font-family: "Nunito", sans-serif;
}

/* ── Section label ── */
.lesson-section-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

/* ── Intro block ── */
.lesson-intro {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 28px;
  font-family: "Source Sans 3", sans-serif;
}

.word-audio-btn {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  color: var(--primary);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: opacity 0.15s;
}

.word-audio-btn:active,
.word-audio-btn--playing {
  opacity: 0.6;
}

.lesson-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(47, 159, 232, 0.07);
  border: 1px solid rgba(47, 159, 232, 0.18);
  border-radius: 12px;
  margin-top: -8px;
}

.lesson-tip p {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.lesson-tip strong {
  color: var(--primary);
}

/* ── Divider ── */
.lesson-divider {
  height: 1px;
  background: rgba(47, 159, 232, 0.12);
  margin: 28px 0;
}

/* ── Phrase cards ── */
.lesson-phrases {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.phrase-card {
  background: rgba(47, 159, 232, 0.06);
  border: 1px solid rgba(47, 159, 232, 0.15);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phrase-card--highlight {
  background: rgba(47, 159, 232, 0.1);
  border-color: rgba(47, 159, 232, 0.25);
}

button.phrase-audio-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.phrase-audio-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phrase-audio-icon {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.phrase-audio-icon img { display: block; }

.phrase-audio-btn--playing .phrase-audio-icon,
.phrase-audio-btn:hover .phrase-audio-icon {
  opacity: 1;
}

.phrase-lt {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--primary);
  font-family: "Nunito", sans-serif;
  letter-spacing: -0.01em;
}

.phrase-en {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  font-family: "Source Sans 3", sans-serif;
}

/* ── Pattern full-sentence display ── */
.pattern-full-sentence {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 20px 16px;
  background: rgba(47, 159, 232, 0.07);
  border: 1.5px solid rgba(47, 159, 232, 0.18);
  border-radius: 14px 14px 0 0;
  border-bottom: none;
  text-align: center;
}

.pattern-full-lt {
  font-family: "Nunito", sans-serif;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 800;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.pattern-full-en {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

/* Known word variant — muted, already learned */
.sentence-part--known {
  background: rgba(6, 38, 61, 0.05);
  border: 1.5px dashed rgba(6, 38, 61, 0.18);
}
.sentence-part--known .sentence-word { color: var(--muted); }
.sentence-part--known .sentence-role { color: var(--muted); opacity: 0.6; }

/* Attach builder flush to the full-sentence card */
.pattern-full-sentence + .sentence-builder {
  border-top: none;
  border-radius: 0 0 14px 14px;
  background: rgba(47, 159, 232, 0.04);
  margin-bottom: 4px;
}

/* Change note below the builder */
.pattern-change-note {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding: 10px 16px;
  background: rgba(47, 159, 232, 0.05);
  border: 1px solid rgba(47, 159, 232, 0.14);
  border-radius: 10px;
  margin-bottom: 24px;
}

.pattern-change-note strong { color: var(--primary); font-weight: 800; }
.pattern-arrow { color: var(--muted); opacity: 0.5; margin: 0 4px; }

/* ── Sentence builder ── */
.sentence-builder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 20px;
  background: rgba(47, 159, 232, 0.06);
  border-radius: 14px;
  border: 1.5px solid rgba(47, 159, 232, 0.18);
  margin-bottom: 4px;
}

.sentence-part {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.sentence-part--ar {
  background: var(--primary);
  border: 1.5px solid var(--primary);
}
.sentence-part--ar .sentence-word { color: white; }
.sentence-part--ar .sentence-role { color: rgba(255,255,255,0.75); }

.sentence-part--sentence {
  background: white;
  border: 1.5px dashed rgba(0,0,0,0.18);
}
.sentence-part--sentence .sentence-word { color: var(--text); }
.sentence-part--sentence .sentence-role { color: var(--muted); }

.sentence-word {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
}

.sentence-role {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.sentence-plus {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.4;
}

/* ── Explanation block ── */
.lesson-explanation {
  margin-bottom: 28px;
}

.lesson-explanation p {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.75;
  margin: 0 0 8px;
  font-family: "Source Sans 3", sans-serif;
}

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

.lesson-explanation strong {
  color: var(--primary);
  font-weight: 800;
}

/* ── Dialogue ── */
.lesson-dialogue {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px;
  background: rgba(47, 159, 232, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(47, 159, 232, 0.14);
  margin-bottom: 16px;
}

.dialogue-line { display: flex; flex-direction: column; gap: 2px; }

.dialogue-speaker {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.dialogue-lt {
  font-family: "Nunito", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.dialogue-en {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Vocab grid ── */
.vocab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 28px;
}

.vocab-item {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vocab-lt {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  font-family: "Nunito", sans-serif;
}

.vocab-en {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  font-family: "Source Sans 3", sans-serif;
}

/* ── Table ── */
.lesson-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-family: "Source Sans 3", sans-serif;
  border-radius: 14px;
  overflow: hidden;
  table-layout: fixed;
}

.lesson-table thead tr {
  background: rgba(47, 159, 232, 0.08);
}

.lesson-table th {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  text-align: left;
  font-family: "Source Sans 3", sans-serif;
}

.lesson-table tbody tr {
  border-top: 1px solid rgba(47, 159, 232, 0.1);
  background: rgba(255, 255, 255, 0.55);
}

.lesson-table tbody tr:last-child {
  border-bottom: 1px solid rgba(47, 159, 232, 0.1);
}

.lesson-table td {
  padding: 12px 14px;
}

.cell-lt {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  font-family: "Nunito", sans-serif;
}

.cell-primary {
  color: var(--primary);
}

.cell-stem {
  color: var(--muted);
  font-weight: 800;
  font-family: "Nunito", sans-serif;
}

.cell-plus {
  color: var(--muted);
  opacity: 0.45;
  font-weight: 700;
  margin: 0 3px;
}

.cell-ending {
  color: var(--primary);
  font-weight: 800;
  font-family: "Nunito", sans-serif;
}

.cell-en {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Pronoun link grid ── */
.lesson-vocab-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.lesson-vocab-grid .vocab-item {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.lesson-vocab-grid .vocab-en {
  margin-left: auto;
  font-size: 0.88rem;
}

.vocab-arrow {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.5;
}

/* ── Dialogue ── */
.lesson-dialogue {
  background: rgba(47, 159, 232, 0.06);
  border: 1px solid rgba(47, 159, 232, 0.15);
  border-radius: 16px;
  padding: 18px 18px 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.dialogue-exchange {
  margin-bottom: 16px;
}
.dialogue-exchange:last-child { margin-bottom: 0; }

.dialogue-line {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  max-width: 82%;
}
.dialogue-line:last-child { margin-bottom: 0; }
.dialogue-line--a { align-items: flex-start; }
.dialogue-line--b { align-items: flex-end; margin-left: auto; }

.dialogue-name {
  font-size: 0.68rem;
  font-weight: 800;
  font-family: "Nunito", sans-serif;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
  padding: 0 4px;
}

.dialogue-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 0.97rem;
  font-weight: 600;
  font-family: "Source Sans 3", sans-serif;
  color: var(--text);
  line-height: 1.5;
}

.dialogue-line--a .dialogue-bubble {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(47, 159, 232, 0.15);
  border-bottom-left-radius: 4px;
}

.dialogue-line--b .dialogue-bubble {
  background: rgba(47, 159, 232, 0.12);
  border: 1px solid rgba(47, 159, 232, 0.25);
  border-bottom-right-radius: 4px;
}

/* ── Dialogue question blocks ── */
.dialogue-q-divider {
  height: 1px;
  background: rgba(47, 159, 232, 0.12);
  margin: 14px 0;
}

.dialogue-exchange-divider {
  height: 1px;
  background: rgba(47, 159, 232, 0.18);
  margin: 18px 0;
}

.dialogue-q-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
  opacity: 0.7;
}

.dialogue-question {
  padding: 0 2px;
  animation: dialogue-reveal 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes dialogue-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dialogue-line--new,
.dialogue-question--new {
  animation: dialogue-reveal 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Recap list ── */
.recap-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.recap-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

button.recap-item {
  background: rgba(47, 159, 232, 0.1);
  border-color: rgba(47, 159, 232, 0.25);
}

button.recap-item .phrase-audio-text {
  flex: 1;
}

.recap-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(52, 201, 137, 0.15);
  border: 1.5px solid #34c989;
  color: #1a7a50;
  font-size: 0.78rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recap-lt {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--primary);
  font-family: "Nunito", sans-serif;
}

.recap-en {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  font-family: "Source Sans 3", sans-serif;
  margin-top: 1px;
}

/* ── Practice ── */
.lesson-practice-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.lesson-practice-progress .progress-track {
  flex: 1;
  height: 14px;
  background: rgba(47, 159, 232, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.lesson-practice-progress .progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0%;
  box-shadow: 0 2px 8px rgba(47, 159, 232, 0.35);
}

.lesson-practice-meta {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  font-family: "Nunito", sans-serif;
}

.practice-q-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

.practice-q-prompt {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-family: "Nunito", sans-serif;
  margin: 0 0 18px;
  line-height: 1.4;
}

.practice-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.practice-opt {
  padding: 13px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  font-family: "Nunito", sans-serif;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.practice-opt:hover:not(:disabled) {
  background: rgba(47, 159, 232, 0.08);
  border-color: #2f9fe8;
  transform: translateX(3px);
}

.practice-opt--correct  { background: rgba(52, 201, 137, 0.15); border-color: #34c989; color: #1a7a50; }
.practice-opt--wrong    { background: rgba(240, 92, 92, 0.12);  border-color: #f05c5c; color: #b83232; }
.practice-opt--disabled { opacity: 0.42; }

.practice-feedback {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 4px;
}
.practice-feedback--correct { background: rgba(52, 201, 137, 0.12); color: #1a7a50; }
.practice-feedback--wrong   { background: rgba(240, 92, 92, 0.1);  color: #b83232; }

/* ── Complete banner ── */
.lesson-complete {
  text-align: center;
  padding: 24px 0 8px;
}

.lesson-complete-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.lesson-complete-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  font-family: "Nunito", sans-serif;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.lesson-complete-sub {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.75;
  font-family: "Source Sans 3", sans-serif;
}

.lesson-complete-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(52, 201, 137, 0.12);
  border: 1px solid #34c989;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #1a7a50;
  font-family: "Nunito", sans-serif;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .vocab-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .phrase-lt { font-size: 1rem; }
  .practice-q-prompt { font-size: 1rem; }
  .dialogue-line { max-width: 90%; }

  .lesson-table th,
  .lesson-table td { padding: 10px 10px; }
  .lesson-table th { font-size: 0.65rem; }
  .cell-lt { font-size: 0.92rem; }
  .cell-en { font-size: 0.78rem; }

  .sentence-builder {
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 14px;
    justify-content: center;
  }

  .sentence-part {
    padding: 8px 14px;
  }

  .sentence-word { font-size: 1rem; }
  .sentence-role { font-size: 0.68rem; }
  .sentence-plus { font-size: 1.1rem; }
}

@media (max-width: 400px) {
  .lesson-table th { font-size: 0.6rem; letter-spacing: 0.04em; padding: 8px 7px; }
  .lesson-table td { padding: 10px 7px; }
  .cell-lt { font-size: 0.88rem; }
  .cell-en { font-size: 0.72rem; }

  .sentence-part { padding: 7px 12px; }
  .sentence-word { font-size: 0.95rem; }
}
