/* ==========================================================================
   CivNode — Language Courses
   Enrolment and dashboard screens. All lc-* prefixed to avoid collisions.
   ========================================================================== */


/* ==========================================================================
   Enrolment screen
   ========================================================================== */

.lc-enrol {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.lc-enrol-header {
  width: 100%;
  text-align: center;
  margin-bottom: 1.25rem;
}

.lc-enrol-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.lc-enrol-header p {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-style: italic;
  color: var(--text-secondary);
}

.lc-enrol-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
}

.lc-enrol-section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Language grid */

.lc-enrol-language-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.lc-enrol-language-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), opacity var(--transition);
  position: relative;
  min-height: 44px;
}

.lc-enrol-language-card:hover:not(.lc-enrol-language-card--disabled) {
  border-color: var(--border-strong);
}

.lc-enrol-language-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 20px color-mix(in srgb, var(--accent) 12%, transparent);
  background: var(--accent-subtle);
}

.lc-enrol-language-card--disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.lc-enrol-flag {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.lc-enrol-lang-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.lc-enrol-lang-native {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

.lc-enrol-coming-soon {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.1875rem 0.4375rem;
}

.lc-enrol-check {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  color: var(--bg-primary);
  font-weight: 900;
}

/* Native language select */

.lc-enrol-select-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lc-enrol-select-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.lc-enrol-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  padding: 0.625rem 2.25rem 0.625rem 1rem;
  flex: 1;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a5650' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  transition: border-color var(--transition);
}

.lc-enrol-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Level list */

.lc-enrol-level-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.lc-enrol-level-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  cursor: pointer;
  min-height: 44px;
  transition: border-color var(--transition), background var(--transition);
}

.lc-enrol-level-card:hover {
  border-color: var(--border-strong);
}

.lc-enrol-level-card--selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.lc-enrol-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition);
}

.lc-enrol-level-card--selected .lc-enrol-radio {
  border-color: var(--accent);
}

.lc-enrol-radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: none;
}

.lc-enrol-level-card--selected .lc-enrol-radio-dot {
  display: block;
}

.lc-enrol-level-code {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  min-width: 2rem;
  font-variant-numeric: tabular-nums;
}

.lc-enrol-level-card--selected .lc-enrol-level-code {
  color: var(--accent);
}

.lc-enrol-level-divider {
  width: 1px;
  height: 28px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.lc-enrol-level-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lc-enrol-level-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: 0.125rem;
}

.lc-enrol-level-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* CTA button */

.lc-enrol-btn {
  width: 100%;
  max-width: 600px;
  background: var(--accent);
  color: var(--bg-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  padding: 1rem 2rem;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 25%, transparent);
  margin-top: 0.25rem;
}

.lc-enrol-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}

.lc-enrol-helper {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}


/* ==========================================================================
   Dashboard screen
   ========================================================================== */

.lc-dashboard {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* Topbar */

.lc-dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 0 1.25rem;
}

.lc-dashboard-course-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.lc-dashboard-course-title span {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 1rem;
  margin-left: 0.5rem;
  font-family: var(--font-sans);
}

.lc-dashboard-stats-pills {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.lc-dashboard-pill {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3125rem 0.75rem;
}

.lc-dashboard-pill--streak {
  color: var(--color-streak, #e8a030);
  border-color: color-mix(in srgb, var(--color-streak, #e8a030) 25%, transparent);
  background: color-mix(in srgb, var(--color-streak, #e8a030) 6%, transparent);
}

.lc-dashboard-pill--xp {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Two-column track grid */

.lc-dashboard-tracks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Track panel */

.lc-track {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.2);
}

.lc-track-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.lc-track-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.lc-track-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.lc-track-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

/* Story track — book card */

.lc-story-book {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lc-story-book-inner {
  display: flex;
  gap: 1rem;
  padding: 1rem;
}

.lc-story-cover {
  width: 80px;
  height: 112px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  position: relative;
  overflow: hidden;
}

.lc-story-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.lc-story-book-title {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.lc-story-book-author {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.lc-cefr-badge {
  display: inline-flex;
  align-items: center;
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.4375rem;
  letter-spacing: 0.05em;
  width: fit-content;
  margin-top: 0.125rem;
}

.lc-story-reading-since {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.375rem;
}

.lc-story-progress {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lc-story-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lc-story-progress-label span:last-child {
  color: var(--accent);
  font-weight: 600;
}

.lc-story-progress-track {
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
}

.lc-story-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.lc-story-continue-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  background: var(--accent);
  color: var(--bg-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  padding: 0.5625rem 1.125rem;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 8px color-mix(in srgb, var(--accent) 20%, transparent);
  min-height: 44px;
}

.lc-story-continue-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Completed books section */

.lc-story-completed-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.lc-story-completed-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
}

.lc-story-completed-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--success) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  color: var(--success);
  flex-shrink: 0;
  font-weight: 700;
}

.lc-story-completed-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
}

.lc-story-completed-cefr {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Empty state */

.lc-story-empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Skills track — unit cards */

.lc-skills-unit {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  transition: border-color var(--transition);
}

.lc-skills-unit--active {
  border-left: 3px solid var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--accent-subtle);
}

.lc-skills-unit--locked {
  opacity: 0.4;
}

.lc-skills-unit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.lc-skills-unit-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.lc-skills-unit--active .lc-skills-unit-title {
  color: var(--accent);
}

.lc-skills-unit-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: var(--radius-sm);
  padding: 0.125rem 0.4375rem;
}

.lc-skills-unit-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Exercise circles row */

.lc-skills-exercises {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

.lc-skills-exercise-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.lc-skills-exercise {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  transition: all var(--transition);
}

.lc-skills-exercise--done {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 1px 6px color-mix(in srgb, var(--accent) 30%, transparent);
}

.lc-skills-exercise--active {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 15%, transparent);
  animation: lc-pulse 2s ease-in-out infinite;
}

.lc-skills-exercise--locked {
  background: var(--bg-primary);
  border: 1.5px solid var(--border-strong);
  color: var(--text-muted);
}

.lc-skills-exercise-label {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 36px;
  line-height: 1.2;
}

.lc-skills-exercise-label--done {
  color: var(--text-secondary);
}

.lc-skills-next-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.lc-skills-next-label strong {
  color: var(--text-primary);
}

.lc-skills-continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--accent);
  color: var(--bg-primary);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  padding: 0.5625rem 1.125rem;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 8px color-mix(in srgb, var(--accent) 20%, transparent);
  min-height: 44px;
}

.lc-skills-continue-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Progress rings */

.lc-progress-rings {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem 0;
}

.lc-progress-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.lc-progress-ring {
  /* SVG sized via width/height attributes on the element */
}

.lc-progress-ring-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.lc-progress-ring-connector {
  flex: 1;
  height: 1px;
  background: var(--border-strong);
  max-width: 2rem;
}

/* Stats bar */

.lc-stats-bar {
  width: 100%;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.lc-stats-bar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  gap: 2rem;
}

.lc-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.lc-stat-value {
  font-weight: 700;
  color: var(--text-primary);
}

.lc-stat-value--streak {
  color: var(--color-streak, #e8a030);
}

.lc-stat-label {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.lc-stat-divider {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
}

/* Pulse animation for active exercise */

@keyframes lc-pulse {
  0%, 100% { box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 15%, transparent); }
  50%       { box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 30%, transparent); }
}


/* ==========================================================================
   Mobile responsive
   ========================================================================== */

@media (max-width: 768px) {
  .lc-dashboard-tracks {
    grid-template-columns: 1fr;
  }

  .lc-story-book-inner {
    flex-direction: column;
    align-items: center;
  }

  .lc-story-cover {
    width: 120px;
    height: 170px;
  }

  .lc-progress-rings {
    gap: 0.75rem;
  }

  .lc-stats-bar-inner {
    font-size: 0.8125rem;
    gap: 1.25rem;
  }

  .lc-enrol {
    padding: 2rem 1rem;
  }

  .lc-enrol-language-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lc-dashboard-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}


/* ==========================================================================
   Story track — reading screen
   ========================================================================== */

/* ── Reader layout ── */

.lc-reader {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-primary);
}

.lc-reader-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 0;
  z-index: 10;
}

.lc-reader-topbar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color 180ms ease;
}

.lc-reader-topbar-back:hover {
  color: var(--text-primary);
}

.lc-reader-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1;
  min-width: 0;
}

.lc-reader-topbar-title {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lc-reader-topbar-progress {
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.lc-reader-topbar-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

/* Thin progress strip immediately below topbar */
.lc-reader-progress-strip {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  z-index: 9;
}

.lc-reader-progress-strip-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 0;
  transition: width 300ms ease;
}

.lc-reader-body {
  flex: 1;
  overflow-y: auto;
  padding: 4rem 2rem;
  padding-top: calc(52px + 4rem);
  padding-bottom: calc(60px + 4rem);
  display: flex;
  justify-content: center;
}

.lc-reader-content {
  width: 100%;
  max-width: 65ch;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.lc-reader-content p + p {
  margin-top: 1.5em;
}

.lc-reader-bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  gap: 0;
  z-index: 10;
}

.lc-reader-bottombar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.lc-reader-bottombar-centre {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.lc-reader-bottombar-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

/* ── Drop cap ── */

.lc-reader-content > p:first-of-type::first-letter {
  font-family: var(--font-serif);
  font-size: 3.2em;
  line-height: 0.8;
  font-weight: 700;
  float: left;
  color: var(--accent);
  padding-right: 0.1em;
  margin-top: 0.05em;
}

/* ── Passage meta ── */

.lc-reader-cefr-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 99px;
  padding: 0.25rem 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.lc-reader-passage-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

/* Ornamental section divider */
.lc-reader-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0;
}

.lc-reader-divider::before,
.lc-reader-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.lc-reader-divider span {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1;
}

/* Vocabulary summary line below passage */
.lc-reader-vocab-meta {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 2rem;
}

.lc-reader-vocab-meta strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── Next-passage button (bottombar) ── */

.lc-reader-next-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem 0;
  transition: color 180ms ease;
}

.lc-reader-next-btn:hover {
  color: var(--accent-hover);
}

/* ── Word spans ── */

.lc-word {
  cursor: pointer;
  border-radius: 2px;
  transition: background 120ms ease;
}

.lc-word:hover {
  background: var(--accent-subtle);
}

.lc-word--selected {
  background: rgba(201, 168, 76, 0.12);
}

/* ── Semantic overlay classes ── */
/* Note: case colours are semantic — specific hues are intentional, not theme colours */

.lc-word--nom {
  display: inline;
  background: rgba(100, 149, 237, 0.10);
  border-radius: 2px;
  box-shadow: -2px 0 0 #6495ED;
  padding: 1px 3px 1px 4px;
}

.lc-word--acc {
  display: inline;
  background: rgba(76, 175, 80, 0.10);
  border-radius: 2px;
  box-shadow: -2px 0 0 #4CAF50;
  padding: 1px 3px 1px 4px;
}

.lc-word--dat {
  display: inline;
  background: rgba(255, 152, 0, 0.10);
  border-radius: 2px;
  box-shadow: -2px 0 0 #FF9800;
  padding: 1px 3px 1px 4px;
}

.lc-word--gen {
  display: inline;
  background: rgba(156, 39, 176, 0.10);
  border-radius: 2px;
  box-shadow: -2px 0 0 #9C27B0;
  padding: 1px 3px 1px 4px;
}

.lc-word--compound {
  text-decoration: underline dotted color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
}

/* cognate: no background — the sibling superscript carries the marker */

.lc-cognate-sup {
  font-size: 0.55rem;
  color: var(--text-muted);
  vertical-align: super;
  margin-left: 1px;
  cursor: default;
  line-height: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Case overlay legend (shown at bottom of passage when overlays active) */

.lc-overlay-legend {
  margin-top: 2.5rem;
  padding: 1rem 1.125rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.lc-overlay-legend-title {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.lc-overlay-legend-items {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.lc-overlay-legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.lc-overlay-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border-left: 2px solid;
  flex-shrink: 0;
}

.lc-overlay-legend-swatch--nom { background: rgba(100, 149, 237, 0.10); border-color: #6495ED; }
.lc-overlay-legend-swatch--acc { background: rgba(76, 175, 80, 0.10);  border-color: #4CAF50; }
.lc-overlay-legend-swatch--dat { background: rgba(255, 152, 0, 0.10);  border-color: #FF9800; }
.lc-overlay-legend-swatch--gen { background: rgba(156, 39, 176, 0.10); border-color: #9C27B0; }

/* ── Overlay toggle buttons (in bottombar) ── */

.lc-overlay-toggle {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3125rem 0.625rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.lc-overlay-toggle:hover {
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.lc-overlay-toggle--active {
  color: var(--bg-primary);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

/* ── Word popover ── */

.lc-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.3),
    0 16px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  z-index: 100;
  overflow: hidden;
  padding: 0;
}

/* Arrow pointing up at the tapped word */
.lc-popover::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
  transform: translateX(-50%) rotate(45deg);
}

/* Arrow pointing down when popover appears above the word */
.lc-popover--above::before {
  top: auto;
  bottom: -7px;
  border-left: none;
  border-top: none;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

/* "Add to Deck" confirmed state */
.lc-popover-btn-add--done {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: default;
}

.lc-popover-body {
  padding: 1.125rem 1.125rem 0;
}

.lc-popover-word {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Inline gender pill — colour varies by gender via modifier classes */
.lc-popover-gender {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  vertical-align: middle;
  margin-left: 0.375rem;
}

/* der — masculine, cornflower blue */
.lc-popover-gender--masc {
  background: rgba(100, 149, 237, 0.15);
  color: #6495ED;
  border: 1px solid rgba(100, 149, 237, 0.3);
}

/* die — feminine, rose */
.lc-popover-gender--fem {
  background: rgba(236, 100, 149, 0.15);
  color: #ec6495;
  border: 1px solid rgba(236, 100, 149, 0.3);
}

/* das — neuter, accent gold */
.lc-popover-gender--neu {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.lc-popover-row1 {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.lc-popover-translation {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  margin-bottom: 0.875rem;
  line-height: 1.4;
}

.lc-popover-sep {
  height: 1px;
  background: var(--border);
  margin: 0 -1.125rem 0.875rem;
}

/* Compound breakdown — flex row of chips with arrow/plus separator */
.lc-popover-compounds {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.lc-popover-compound-label {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

.lc-popover-compound-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.25rem 0.625rem;
  gap: 0.1rem;
  font-size: 0.8125rem;
}

.lc-popover-compound-chip-word {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.lc-popover-compound-chip-gloss {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  color: var(--text-muted);
  font-weight: 500;
}

.lc-popover-compound-arrow {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1;
}

/* CEFR + IPA meta row */
.lc-popover-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  margin-top: 0.5rem;
}

.lc-popover-cefr {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 99px;
  padding: 0.2rem 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lc-popover-ipa {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Action footer */
.lc-popover-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.875rem 1.125rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.lc-popover-btn-add {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bg-primary);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 180ms ease;
}

.lc-popover-btn-add:hover {
  background: var(--accent-hover);
}

.lc-popover-btn-hear {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: color 180ms ease, border-color 180ms ease;
}

.lc-popover-btn-hear:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Popover anchor wrapper */
.lc-popover-anchor {
  position: relative;
  display: inline;
}

/* ── Audio bar ── */

.lc-audio-bar {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-strong);
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

/* Sentence progress track */
.lc-audio-sentence-progress {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.lc-audio-sentence-label {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.lc-audio-progress {
  flex: 1;
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.lc-audio-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 300ms ease;
}

.lc-audio-sentence-count {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Controls */
.lc-audio-controls {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.lc-audio-btn {
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 180ms ease, border-color 180ms ease;
}

.lc-audio-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.lc-audio-btn svg {
  width: 14px;
  height: 14px;
}

.lc-audio-btn--play {
  width: 52px;
  height: 52px;
  background: var(--accent);
  border: none;
  color: var(--bg-primary);
  box-shadow: 0 0 0 6px rgba(201, 168, 76, 0.12), 0 4px 12px rgba(201, 168, 76, 0.25);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.lc-audio-btn--play:hover {
  background: var(--accent-hover);
}

/* Speed pills */
.lc-audio-speed {
  display: flex;
  flex-direction: row;
  gap: 0.25rem;
}

.lc-audio-speed-pill {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  transition: color 180ms ease, background 180ms ease;
}

.lc-audio-speed-pill--active {
  color: var(--bg-primary);
  background: var(--accent);
  border-color: var(--accent);
}

/* Active sentence highlight in passage text */
.lc-audio-sentence {
  background: rgba(201, 168, 76, 0.12);
  border-radius: 3px;
  transition: background 200ms ease;
}

/* ── Shadowing panel ── */

.lc-shadow-panel {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 0.875rem 1.25rem 1.125rem;
}

.lc-shadow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}

.lc-shadow-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lc-shadow-prompt {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  line-height: 1.5;
}

.lc-shadow-transcript {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.6;
  margin-top: 0.5rem;
  color: var(--text-secondary);
}

.lc-shadow-match {
  color: var(--success);
}

.lc-shadow-miss {
  color: var(--error);
  text-decoration: line-through;
}

.lc-shadow-accuracy {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 25%, transparent);
  border-radius: 99px;
  padding: 0.2rem 0.5rem;
}

.lc-shadow-accuracy-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.lc-shadow-accuracy-label {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Microphone pulsing indicator */
.lc-shadow-mic {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  color: var(--error);
  font-weight: 600;
  margin-top: 0.5rem;
}

.lc-shadow-mic-dot {
  width: 6px;
  height: 6px;
  background: var(--error);
  border-radius: 50%;
  animation: lc-mic-pulse 1.2s ease infinite;
  flex-shrink: 0;
}

@keyframes lc-mic-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

/* Shadow row comparison layout */
.lc-shadow-compare {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lc-shadow-row {
  display: flex;
  gap: 0.625rem;
  align-items: baseline;
}

.lc-shadow-badge {
  font-family: var(--font-sans);
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin-top: 2px;
}

.lc-shadow-badge--orig {
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.lc-shadow-badge--you {
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Toggle switch for shadow mode on/off */
.lc-shadow-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.lc-shadow-toggle-label {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent);
}

.lc-shadow-switch {
  width: 34px;
  height: 18px;
  background: var(--accent);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  border: none;
  transition: background 180ms ease;
}

.lc-shadow-switch::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--bg-primary);
  border-radius: 50%;
  top: 2px;
  right: 2px;
  transition: right 180ms ease;
}

.lc-shadow-switch--off {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
}

.lc-shadow-switch--off::after {
  right: auto;
  left: 2px;
}


/* ==========================================================================
   Story track — reading screen mobile responsive
   ========================================================================== */

@media (max-width: 768px) {
  .lc-reader-body {
    padding: 3.5rem 1rem 5rem;
    padding-top: calc(48px + 3.5rem);
  }

  .lc-reader-content {
    font-size: 1.1875rem;
  }

  /* On mobile the popover becomes a bottom sheet */
  .lc-popover {
    position: fixed;
    bottom: 56px;
    left: 0;
    right: 0;
    top: auto;
    max-width: none;
    width: auto;
    transform: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
  }

  .lc-popover::before {
    display: none;
  }

  .lc-audio-btn--play {
    width: 44px;
    height: 44px;
  }

  .lc-overlay-toggle {
    min-height: 44px;
    padding: 0 0.5rem;
  }
}


/* ==========================================================================
   Skills Track — exercise shell
   ========================================================================== */

.lc-exercise {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.lc-exercise-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.lc-exercise-unit-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.lc-exercise-unit-title {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.125rem;
}

.lc-exercise-progress-dots {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.lc-exercise-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.lc-exercise-dot--active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 40%, transparent);
}

.lc-exercise-dot--done {
  background: var(--accent);
  border-color: var(--accent);
}

.lc-exercise-body {
  padding: 0.5rem 0;
}

.lc-exercise-actions {
  padding-top: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}


/* ==========================================================================
   Skills Track — grammar card
   ========================================================================== */

.lc-grammar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.lc-grammar-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.lc-grammar-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  line-height: 1.6;
}

.lc-grammar-table-wrap {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lc-grammar-table {
  width: 100%;
  border-collapse: collapse;
}

.lc-grammar-table thead tr {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-strong);
}

.lc-grammar-table th {
  padding: 0.5rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
}

.lc-grammar-table tbody tr {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.lc-grammar-table tbody tr:last-child {
  border-bottom: none;
}

.lc-grammar-table tbody tr:hover {
  background: color-mix(in srgb, var(--bg-elevated) 80%, var(--accent) 8%);
}

.lc-grammar-table td {
  padding: 0.5rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.lc-grammar-table tbody tr:last-child td {
  border-bottom: none;
}

.conj-ending {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--accent);
  font-weight: 700;
}

.conj-example {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.lc-grammar-examples {
  margin-top: 1.5rem;
}

.lc-grammar-example {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-secondary);
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  margin-bottom: 0.625rem;
  line-height: 1.6;
}

.lc-grammar-illustration {
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
  overflow: hidden;
}

.lc-grammar-illustration img {
  max-width: 280px;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
}


/* ==========================================================================
   Skills Track — typing drill
   ========================================================================== */

.lc-typing-instruction {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.lc-typing-sentence {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 2.2;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.lc-typing-gap {
  display: inline-block;
  min-width: 120px;
  border: none;
  border-bottom: 2px solid var(--accent);
  background: transparent;
  font-family: var(--font-serif);
  font-size: inherit;
  color: var(--text-primary);
  text-align: center;
  outline: none;
  padding: 0.2rem 0.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  caret-color: var(--accent);
}

.lc-typing-gap:focus {
  border-bottom-color: var(--accent-hover);
  box-shadow: 0 2px 0 var(--accent-subtle);
}

.lc-typing-feedback {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}

.lc-typing-feedback--correct {
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border-left: 3px solid var(--success);
  color: var(--success);
}

.lc-typing-feedback--wrong {
  background: color-mix(in srgb, var(--error) 10%, transparent);
  border-left: 3px solid var(--error);
  color: var(--error);
}

.lc-typing-progress {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.lc-typing-sentence-wrap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 2.2;
  color: var(--text-primary);
}

.lc-typing-submit-btn {
  margin-top: 0.5rem;
}

.lc-typing-next-btn {
  margin-top: 0.75rem;
}


/* ==========================================================================
   Skills Track — speaking drill
   ========================================================================== */

.lc-speaking-progress {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.lc-speaking-instruction {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.lc-speaking-listen-btn {
  margin-top: 1.25rem;
}

.lc-speaking-sentence {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  color: var(--text-primary);
  text-align: center;
  padding: 1.25rem 1.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  width: 100%;
}

.lc-speaking-mic-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.75rem auto 0.25rem;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  color: var(--accent);
  font-size: 1.5rem;
}

.lc-speaking-mic-btn:hover {
  background: var(--accent-subtle);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 20%, transparent);
}

.lc-speaking-mic-btn--recording {
  background: color-mix(in srgb, var(--error) 15%, transparent);
  border-color: var(--error);
  animation: lc-mic-pulse 1.5s infinite;
}

@keyframes lc-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--error) 30%, transparent); }
  50%       { box-shadow: 0 0 0 10px color-mix(in srgb, var(--error) 0%, transparent); }
}

.lc-speaking-transcript {
  text-align: center;
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 1.125rem;
}

.lc-speaking-accuracy {
  display: inline-block;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0.75rem;
  font-weight: 700;
  margin-top: 0.75rem;
}


/* ==========================================================================
   Skills Track — writing exercise
   ========================================================================== */

.lc-writing-instruction {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  line-height: 1.5;
}

.lc-writing-editor {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  min-height: 160px;
  padding: 1rem;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-primary);
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  caret-color: var(--accent);
}

.lc-writing-editor:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.lc-writing-btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.lc-writing-corrections {
  margin-top: 1.5rem;
}

.lc-writing-correction {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--error);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.lc-writing-correction--ok {
  border-left-color: var(--success, #4caf50);
  color: var(--text-secondary);
}

.lc-writing-correction-suggestion {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.lc-writing-correction-context {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  white-space: pre-wrap;
}

.lc-writing-correction-highlight {
  background: color-mix(in srgb, var(--error, #ef5350) 20%, transparent);
  color: var(--error, #ef5350);
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 600;
  text-decoration: underline wavy var(--error, #ef5350);
}

.lc-writing-ai-feedback {
  margin-top: 1.5rem;
}

.lc-writing-ai-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  font-family: var(--font-serif);
}

.lc-writing-complete-btn {
  margin-top: 2rem;
}


/* ==========================================================================
   Skills Track — conversation
   ========================================================================== */

.lc-convo {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  overflow: hidden;
}

.lc-convo-system {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  padding: 0.875rem 1.5rem;
  font-style: italic;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.lc-convo-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.lc-convo-bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.lc-convo-bubble--ai {
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-sm);
}

.lc-convo-bubble--user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-bottom-right-radius: var(--radius-sm);
}

.lc-convo-input {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.lc-convo-text-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  caret-color: var(--accent);
}

.lc-convo-text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.lc-convo-send-btn {
  padding: 0.575rem 1.1rem;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
  white-space: nowrap;
}

.lc-convo-send-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 30%, transparent);
}

.lc-convo-mic-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.lc-convo-mic-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent);
}

/* End conversation button */
.lc-convo-end-btn {
  align-self: center;
  margin: 0.5rem 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lc-convo-end-btn:hover {
  color: var(--text-secondary);
}

/* Mic recording state */
.lc-convo-mic-btn--recording {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}

/* Typing indicator as a bubble variant */
.lc-convo-bubble--typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.625rem 0.875rem;
  min-height: 0;
}

/* Typing indicator (standalone, legacy) */
.lc-convo-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.625rem 0.875rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
}

.lc-convo-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: lc-typing-bounce 1.2s infinite ease-in-out;
}

.lc-convo-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.lc-convo-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes lc-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}


/* ==========================================================================
   Skills Track — mobile responsive
   ========================================================================== */

@media (max-width: 768px) {
  .lc-exercise {
    padding: 1rem;
  }

  .lc-grammar-card {
    padding: 1.25rem;
  }

  .lc-speaking-mic-btn {
    width: 56px;
    height: 56px;
  }

  .lc-convo-bubble {
    max-width: 90%;
  }

  .lc-convo {
    height: calc(100vh - 96px);
  }
}

/* ==========================================================================
   Dashboard section headers — h3 reset when used as lc-track-header (T7-6)
   ========================================================================== */

h3.lc-track-header {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
  padding: 0.5rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* ==========================================================================
   Sticker collectables (T7-4)
   ========================================================================== */

.lc-stickers-section {
  margin-top: 2rem;
}

.lc-sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.lc-sticker-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 0.75rem;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.lc-sticker-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.lc-sticker-card--locked {
  opacity: 0.35;
}

.lc-sticker-icon {
  width: 48px;
  height: 56px;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Common shape base */

.lc-sticker-shape {
  background: var(--sc, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.875rem;
  line-height: 1;
}

/* Shield: 48×56 */

.lc-sticker-shape--shield {
  width: 48px;
  height: 56px;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
}

/* Ribbon: 48×56 with a curved bottom */

.lc-sticker-shape--ribbon {
  width: 48px;
  height: 56px;
  border-radius: 24px 24px 50% 50%;
}

/* Star: 48×48 */

.lc-sticker-shape--star {
  width: 48px;
  height: 48px;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Circle: streak + level */

.lc-sticker-shape--circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.lc-sticker-shape-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 800;
  color: #fff;
}

.lc-sticker-label {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.lc-sticker-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.35;
}

.lc-sticker-lock {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font-size: 0.625rem;
  opacity: 0.6;
}

/* ==========================================================================
   Dashboard — CEFR progress rings (T7-6)
   ========================================================================== */

.lc-progress-rings {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.lc-progress-ring-wrap {
  text-align: center;
}

.lc-progress-ring-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-family: var(--font-sans);
  min-height: 1rem;
}

/* ==========================================================================
   Dashboard — recent activity (T7-6)
   ========================================================================== */

.lc-recent-activity {
  margin-top: 1.5rem;
}

.lc-recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  gap: 0.75rem;
}

.lc-recent-item:last-child {
  border-bottom: none;
}

.lc-recent-item-name {
  color: var(--text-primary);
}

.lc-recent-item-time {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 0.8125rem;
}

/* ==========================================================================
   Dashboard — streak flame animation (T7-6)
   ========================================================================== */

.lc-streak-flame {
  animation: lc-flame-flicker 2s ease-in-out infinite;
}

@keyframes lc-flame-flicker {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; transform: scale(1.05); }
}

/* ==========================================================================
   Floating action buttons (T7-5)
   ========================================================================== */

.lc-fab {
  position: fixed;
  bottom: 80px;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 50;
}

.lc-fab-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  line-height: 1;
  font-family: var(--font-sans);
  font-weight: 700;
}

.lc-fab-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
}

.lc-fab-btn--ask {
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 700;
  border-color: var(--accent);
}

.lc-fab-btn--ask:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Ask panel */

.lc-ask-panel {
  position: fixed;
  bottom: 190px;
  right: 1.5rem;
  width: 360px;
  max-height: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  z-index: 51;
  display: flex;
  flex-direction: column;
}

.lc-ask-panel--hidden {
  display: none;
}

.lc-ask-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  flex-shrink: 0;
}

.lc-ask-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0.125rem 0.25rem;
  line-height: 1;
  transition: color var(--transition);
}

.lc-ask-close-btn:hover {
  color: var(--text-primary);
}

.lc-ask-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  max-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.lc-ask-msg {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 90%;
}

.lc-ask-msg--user {
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  align-self: flex-end;
  color: var(--text-primary);
}

.lc-ask-msg--assistant {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  align-self: flex-start;
  color: var(--text-primary);
}

.lc-ask-msg--error {
  background: color-mix(in srgb, var(--error, #c0392b) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--error, #c0392b) 25%, transparent);
  align-self: flex-start;
  color: var(--error, #c0392b);
}

.lc-ask-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.lc-ask-input-field {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.875rem;
  padding: 0.4375rem 0.75rem;
  font-family: var(--font-sans);
  transition: border-color var(--transition);
}

.lc-ask-input-field:focus {
  outline: none;
  border-color: var(--accent);
}

.lc-ask-send-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: var(--bg-primary);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.4375rem 0.875rem;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.lc-ask-send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.lc-ask-send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .lc-ask-panel {
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    bottom: 150px;
  }
}
