/* Home mode skill tags — soft translucent blue */
.home-mode-tag {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

/* Word score color classes */
.word-score-100 {
    color: #059669; /* Green */
    font-weight: 600;
}
.word-score-90 {
    color: #059669; /* Green */
}
.word-score-80 {
    color: #10B981; /* Light green */
}
.word-score-70 {
    color: #6EE7B7; /* Lighter green */
}
.word-score-60 {
    color: #34D399; /* Pale green */
}
.word-score-50 {
    color: #F59E0B; /* Yellow */
}
.word-score-40 {
    color: #F97316; /* Orange */
}
.word-score-30 {
    color: #EF4444; /* Red */
}
.word-score-20 {
    color: #DC2626; /* Darker red */
}
.word-score-10 {
    color: #B91C1C; /* Dark red */
}
.word-score-0 {
    color: #7F1D1D; /* Very dark red */
}

/* Clickable words styling */
.word-by-word .clickable-word {
    display: inline-block;
    padding: 1px 3px;
    margin: 0 1px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.word-by-word .clickable-word:hover {
    background-color: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.word-by-word .word-speaking {
    background-color: rgba(37, 99, 235, 0.15);
    color: #2563eb;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Topic selector styling */
.topic-selector {
    transition: all 0.2s ease;
}

.topic-selector:hover {
    background-color: #dbeafe;
    color: #1d4ed8;
    transform: translateY(-2px);
}

/* Translation text styling */
#practiceTranslation, #translationText {
    color: #6b7280;
    font-style: italic;
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin-top: 0.5rem;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: conic-gradient(#3b82f6, rgba(255, 255, 255, 0.3));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Wave animation */
.wave-container {
    background: var(--teacher-primary-dark);
    border-radius: 16px;
    padding: 1rem;
}

#waveform,
#chatWaveform {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: visible;
}

#waveform {
    min-height: 60px;
    gap: 3px;
    padding: 0 10px;
}

#chatWaveform {
    min-height: 40px;
    gap: 2px;
    padding: 0 8px;
    background: #fff;
}

.wave-bar {
    background-color: rgba(255, 255, 255, 0.9);
    width: 4px;
    min-height: 4px;
    margin: 0;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: center;
}

.chat-wave-bar {
    background-color: #2563eb;
    width: 3px;
    min-height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: center;
}

.unit-img-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
}

.unit-img-zoom-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.scrollbar-hide {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

:root {
    --teacher-bg: #F7F8FC;
    --teacher-card: #FFFFFF;
    --teacher-border: rgba(0, 0, 0, 0.08);
    --teacher-border-strong: rgba(0, 0, 0, 0.10);
    --teacher-text: #1A1A1A;
    --teacher-text-secondary: #6B7280;
    --teacher-primary: #1D9E75;
    --teacher-primary-dark: #0F6E56;
    --teacher-primary-soft: #E1F5EE;
    --teacher-secondary: #534AB7;
    --teacher-secondary-soft: #EEEDFE;
    --teacher-amber: #EF9F27;
    --teacher-sidebar-width: 260px;
    --teacher-sidebar-gap: 32px;
    --teacher-surface-muted: #F5F5F7;
    --teacher-surface-hover: #ECECF1;
    --teacher-nav-active: #ECECF1;
    --chat-user-bubble: #E4EEFC;
    --chat-user-ink: #142033;
    --chat-user-ink-secondary: #1E4A8C;
    --chat-user-avatar: #2563EB;
    --chat-assistant-bubble: var(--teacher-surface-muted);
    --chat-assistant-ink: var(--teacher-text);
    color-scheme: light;
}

html[data-theme="dark"] {
    --teacher-bg: #12141A;
    --teacher-card: #1C1F28;
    --teacher-border: rgba(255, 255, 255, 0.10);
    --teacher-border-strong: rgba(255, 255, 255, 0.14);
    --teacher-text: #F3F4F6;
    --teacher-text-secondary: #9CA3AF;
    --teacher-primary: #3ECF8E;
    --teacher-primary-dark: #2BB87A;
    --teacher-primary-soft: rgba(62, 207, 142, 0.16);
    --teacher-secondary: #8B83E8;
    --teacher-secondary-soft: rgba(83, 74, 183, 0.28);
    --teacher-amber: #EF9F27;
    --teacher-surface-muted: #252833;
    --teacher-surface-hover: #2E3340;
    --teacher-nav-active: #2E3340;
    --chat-user-bubble: #1C2F4A;
    --chat-user-ink: #F1F5F9;
    --chat-user-ink-secondary: #93C5FD;
    --chat-user-avatar: #3B82F6;
    --chat-assistant-bubble: var(--teacher-surface-hover);
    --chat-assistant-ink: var(--teacher-text);
    color-scheme: dark;
}

/* Theme toggle */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 0.5px solid var(--teacher-border);
    background: var(--teacher-card);
    color: var(--teacher-text-secondary);
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: var(--teacher-surface-hover);
    color: var(--teacher-text);
}

.theme-toggle-btn:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

.theme-toggle-btn .theme-icon-sun,
.theme-toggle-btn .theme-icon-moon {
    font-size: 18px;
    line-height: 1;
}

html[data-theme="dark"] .theme-toggle-btn .theme-icon-moon,
html:not([data-theme="dark"]) .theme-toggle-btn .theme-icon-sun {
    display: none;
}

.teacher-sidebar-theme-row {
    display: none;
}

@media (min-width: 1024px) {
    body.desktop-sidebar-active .teacher-sidebar-theme-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 0 4px;
        margin-top: 4px;
    }

    body.desktop-sidebar-active .teacher-sidebar-theme-row .theme-toggle-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
}

/* Dark shell + Tailwind utility remaps (CDN has no dark: variant config) */
html[data-theme="dark"] body,
html[data-theme="dark"] body.bg-gray-50,
html[data-theme="dark"] body.desktop-sidebar-active {
    background-color: var(--teacher-bg) !important;
    color: var(--teacher-text);
}

html[data-theme="dark"] .app-header,
html[data-theme="dark"] .app-header.bg-white,
html[data-theme="dark"] .desktop-sidebar,
html[data-theme="dark"] .desktop-sidebar.bg-white,
html[data-theme="dark"] #bottomNav,
html[data-theme="dark"] #bottomNav.bg-white,
html[data-theme="dark"] #bootSplash,
html[data-theme="dark"] #bootSplash.bg-white {
    background-color: var(--teacher-card) !important;
    border-color: var(--teacher-border);
    color: var(--teacher-text);
}

html[data-theme="dark"] .bg-white { background-color: var(--teacher-card) !important; }
html[data-theme="dark"] .bg-white\/80,
html[data-theme="dark"] .bg-white\/90 { background-color: rgba(28, 31, 40, 0.88) !important; }
html[data-theme="dark"] .bg-gray-50 { background-color: var(--teacher-bg) !important; }
html[data-theme="dark"] .bg-gray-100 { background-color: var(--teacher-surface-muted) !important; }
html[data-theme="dark"] .bg-gray-200 { background-color: var(--teacher-surface-hover) !important; }
html[data-theme="dark"] .hover\:bg-gray-50:hover { background-color: var(--teacher-surface-hover) !important; }
html[data-theme="dark"] .hover\:bg-gray-100:hover { background-color: var(--teacher-surface-hover) !important; }

html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800 { color: var(--teacher-text) !important; }
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-600 { color: #CBD5E1 !important; }
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-400 { color: var(--teacher-text-secondary) !important; }
html[data-theme="dark"] .text-gray-300 { color: #6B7280 !important; }

html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-gray-300 { border-color: var(--teacher-border) !important; }
html[data-theme="dark"] .divide-gray-100 > :not([hidden]) ~ :not([hidden]),
html[data-theme="dark"] .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--teacher-border) !important;
}

html[data-theme="dark"] .shadow-sm,
html[data-theme="dark"] .shadow,
html[data-theme="dark"] .shadow-md,
html[data-theme="dark"] .shadow-lg,
html[data-theme="dark"] .shadow-xl {
    --tw-shadow-color: rgba(0, 0, 0, 0.45);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.45), 0 1px 2px -1px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .text-blue-600,
html[data-theme="dark"] .text-blue-700,
html[data-theme="dark"] .text-blue-800 { color: #93C5FD !important; }
html[data-theme="dark"] .bg-blue-50 { background-color: rgba(59, 130, 246, 0.14) !important; }
html[data-theme="dark"] .bg-blue-100 { background-color: rgba(59, 130, 246, 0.22) !important; }
html[data-theme="dark"] .border-blue-100,
html[data-theme="dark"] .border-blue-200 { border-color: rgba(147, 197, 253, 0.28) !important; }

html[data-theme="dark"] .bg-green-50,
html[data-theme="dark"] .bg-emerald-50 { background-color: var(--teacher-primary-soft) !important; }
html[data-theme="dark"] .text-green-700,
html[data-theme="dark"] .text-emerald-700,
html[data-theme="dark"] .text-green-800 { color: var(--teacher-primary) !important; }

html[data-theme="dark"] .bg-yellow-50,
html[data-theme="dark"] .bg-amber-50 { background-color: rgba(239, 159, 39, 0.14) !important; }
html[data-theme="dark"] .text-yellow-700,
html[data-theme="dark"] .text-amber-700,
html[data-theme="dark"] .text-yellow-800 { color: #FBBF24 !important; }

html[data-theme="dark"] .bg-red-50,
html[data-theme="dark"] .bg-rose-50 { background-color: rgba(239, 68, 68, 0.14) !important; }
html[data-theme="dark"] .text-red-600,
html[data-theme="dark"] .text-red-700 { color: #F87171 !important; }

html[data-theme="dark"] .bg-purple-50,
html[data-theme="dark"] .bg-indigo-50 { background-color: var(--teacher-secondary-soft) !important; }
html[data-theme="dark"] .text-purple-700,
html[data-theme="dark"] .text-indigo-700 { color: var(--teacher-secondary) !important; }

html[data-theme="dark"] .desktop-nav-btn {
    background: var(--teacher-surface-muted);
    color: var(--teacher-text-secondary);
}

html[data-theme="dark"] .desktop-nav-btn:hover,
html[data-theme="dark"] .desktop-nav-btn.is-active {
    background: var(--teacher-nav-active);
    color: var(--teacher-text);
}

html[data-theme="dark"] .teacher-sidebar-brand-icon {
    background: #4F8FF7;
}

html[data-theme="dark"] #chatWaveform {
    background: var(--teacher-card);
}

html[data-theme="dark"] ::selection {
    background: rgba(62, 207, 142, 0.35);
    color: #F3F4F6;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background-color: var(--teacher-surface-muted);
    color: var(--teacher-text);
    border-color: var(--teacher-border-strong);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #6B7280;
}

.premium-upsell-card {
  background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
}

.premium-upsell-card:hover {
  filter: brightness(1.02);
}

@media (max-width: 639px) {
  #initialMenuPage {
    padding-bottom: 4.5rem;
  }
}

/* Home stats chips (preview strip above Metas de hoje; remove via #homeStatsChips) */
.home-stats-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.375rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.home-stats-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 0;
  max-width: 100%;
  min-height: 2.25rem;
  padding: 0.375rem 0.625rem;
  border-radius: 9999px;
  border: 0.5px solid var(--teacher-border);
  background: var(--teacher-card);
  color: var(--teacher-text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.home-stats-chip--words {
  grid-column: 1 / -1;
}

button.home-stats-chip {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
}

.home-stats-chip.is-clickable {
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.home-stats-chip.is-clickable:hover {
  background: var(--teacher-surface-hover);
}

.home-stats-chip.is-clickable:focus-visible {
  outline: 2px solid var(--teacher-primary);
  outline-offset: 2px;
}

.home-stats-chip-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.home-stats-chip-icon.streak {
  color: var(--teacher-amber);
}

.home-stats-chip-icon.pron {
  color: var(--teacher-primary-dark);
}

.home-stats-chip-icon.saved {
  color: var(--teacher-secondary);
}

.home-stats-chip-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--teacher-text);
}

.home-stats-chip-suffix {
  display: none;
  font-weight: 500;
  color: var(--teacher-text-secondary);
}

.home-stats-chip-label {
  margin-left: 0.1rem;
  padding-left: 0.4rem;
  border-left: 0.5px solid var(--teacher-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teacher-text-secondary);
  white-space: nowrap;
}

/* Hide on lg+ where sidebar already shows streak/pronúncia/words cards */
@media (min-width: 1024px) {
  #homeStatsChips {
    display: none;
  }
}

/* Large phones / tablets: one row of three equal chips */
@media (min-width: 480px) {
  .home-stats-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-stats-chip--words {
    grid-column: auto;
  }
}

@media (min-width: 640px) {
  .home-stats-chip-suffix {
    display: inline;
  }
}

/* Slightly tighter labels on very narrow phones */
@media (max-width: 380px) {
  .home-stats-chip {
    padding: 0.35rem 0.5rem;
    gap: 0.25rem;
  }

  .home-stats-chip-label {
    font-size: 0.6875rem;
    padding-left: 0.3rem;
  }
}

/* Metas de hoje — compact home card (collapsible) */
.home-daily-trail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-daily-trail-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  border-radius: 0.75rem;
}

.home-daily-trail-toggle:focus-visible {
  outline: 2px solid var(--teacher-primary);
  outline-offset: 2px;
}

.home-daily-trail-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.home-daily-trail-toggle-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.4rem;
  min-width: 0;
}

.home-daily-trail-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--teacher-text);
}

.home-daily-trail-toggle-sep {
  color: var(--teacher-text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
}

.home-daily-trail-count {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: var(--teacher-surface-muted);
  color: var(--teacher-text);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.home-daily-trail-next-hint {
  display: none;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--teacher-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-daily-trail.is-collapsed .home-daily-trail-next-hint:not(:empty) {
  display: block;
}

.home-daily-trail-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  color: var(--teacher-text-secondary);
  transition: transform 160ms ease;
}

.home-daily-trail.is-collapsed .home-daily-trail-chevron {
  transform: rotate(-90deg);
}

.home-daily-trail-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-daily-trail.is-collapsed .home-daily-trail-body {
  display: none;
}

.home-daily-trail-subtitle {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--teacher-text-secondary);
}

.home-daily-trail-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.home-daily-trail-step {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.35rem 0.25rem 0.15rem;
}

.home-daily-trail-step-top {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.25rem;
}

.home-daily-trail-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  border: 2px solid var(--teacher-border-strong);
  background: var(--teacher-card);
  color: var(--teacher-text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.home-daily-trail-step.is-done .home-daily-trail-marker {
  border-color: var(--teacher-primary);
  background: var(--teacher-primary);
  color: #fff;
}

.home-daily-trail-step.is-in_progress .home-daily-trail-marker,
.home-daily-trail-step.is-current .home-daily-trail-marker {
  border-color: #2563eb;
  background: var(--teacher-card);
  color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.home-daily-trail-connector {
  flex: 1;
  height: 2px;
  background: var(--teacher-border-strong);
  border-radius: 9999px;
}

.home-daily-trail-step.is-done .home-daily-trail-connector {
  background: var(--teacher-primary);
}

.home-daily-trail-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teacher-text);
  line-height: 1.2;
}

.home-daily-trail-hint {
  font-size: 0.6875rem;
  color: var(--teacher-text-secondary);
  line-height: 1.25;
}

.home-daily-trail-step.is-done .home-daily-trail-hint {
  color: var(--teacher-primary-dark);
}

.home-daily-trail-step.is-current .home-daily-trail-hint,
.home-daily-trail-step.is-in_progress .home-daily-trail-hint {
  color: var(--teacher-text-secondary);
}

.home-daily-trail-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Nested practice shortcuts inside Metas de hoje (behind “Mais opções”) */
.home-trail-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 0 0;
}

.home-trail-shortcuts.hidden,
.home-trail-shortcuts[hidden] {
  display: none !important;
}

.home-trail-more-options-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 2.25rem;
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--teacher-text-secondary);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.home-trail-more-options-btn:hover {
  background: var(--teacher-surface-muted);
  color: var(--teacher-text);
}

.home-trail-more-options-btn:focus-visible {
  outline: 2px solid var(--teacher-primary);
  outline-offset: 2px;
}

.home-trail-more-options-chevron {
  display: inline-flex;
  transition: transform 160ms ease;
}

.home-trail-more-options-btn[aria-expanded="true"] .home-trail-more-options-chevron {
  transform: rotate(180deg);
}

.home-trail-shortcuts-panel[hidden] {
  display: none !important;
}

.home-trail-shortcuts-panel:not([hidden]) {
  display: block;
  padding-top: 0.15rem;
}

.home-trail-shortcuts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.home-trail-shortcut-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--teacher-border);
  border-radius: 0.75rem;
  background: var(--teacher-surface-muted);
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.home-trail-shortcut-btn:hover {
  background: var(--teacher-surface-hover);
  border-color: var(--teacher-border-strong);
}

.home-trail-shortcut-btn:focus-visible {
  outline: 2px solid var(--teacher-primary);
  outline-offset: 2px;
}

.home-trail-shortcut-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--teacher-text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-trail-shortcut-hint {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-daily-trail-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
}

.home-daily-trail-cta {
  width: 100%;
  min-height: 2.5rem;
  border: 0;
  border-radius: 9999px;
  background: var(--teacher-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 110, 86, 0.28);
  transition: background-color 160ms ease, filter 160ms ease;
}

.home-daily-trail-cta:hover {
  background: var(--teacher-primary-dark);
  filter: none;
}

.home-daily-trail-cta:focus-visible {
  outline: 2px solid var(--teacher-primary);
  outline-offset: 2px;
}

.home-daily-trail-cta:disabled {
  opacity: 0.55;
  cursor: default;
  filter: none;
}

/* display:flex on done must not beat Tailwind .hidden / [hidden] */
.home-daily-trail-cta.hidden,
.home-daily-trail-cta[hidden],
.home-daily-trail-done.hidden,
.home-daily-trail-done[hidden] {
  display: none !important;
}

.home-daily-trail-done:not(.hidden):not([hidden]) {
  width: 100%;
  margin: 0;
  text-align: center;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--teacher-primary-soft);
  color: var(--teacher-primary-dark);
  font-size: 0.875rem;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .home-daily-trail-cta,
  .home-trail-shortcut-btn,
  .home-daily-trail-chevron,
  .home-trail-more-options-btn,
  .home-trail-more-options-chevron {
    transition: none;
  }
}

@media (max-width: 639px) {
  .home-daily-trail {
    gap: 0.55rem;
    padding: 0.85rem 0.9rem !important;
  }

  .home-daily-trail-subtitle {
    display: block;
    font-size: 0.6875rem; /* keep timebox; ≥11px floor */
  }

  .home-daily-trail-steps {
    gap: 0.2rem;
  }

  .home-daily-trail-label {
    font-size: 0.6875rem;
  }

  .home-daily-trail-hint {
    font-size: 0.6875rem; /* ≥11px floor for functional text */
    color: #374151;
  }

  .home-daily-trail-cta,
  .home-daily-trail-done:not(.hidden):not([hidden]) {
    min-height: 2.5rem; /* 40px+ touch */
    font-size: 0.8125rem;
  }
}

/* Roleplay briefing + picker tokens — see #chatPage.is-roleplay / .roleplay-pick-popup below */

/* Home: altura mínima dos cards (.home-panel).
   O card cresce com o conteúdo, mas este min-height força uma "altura base". */
.home-panel {
    min-height: 5rem;
}

.home-panel-lg {
    min-height: 19rem;
}

.home-desktop-shell {
    width: 100%;
    min-height: 24rem;
}

.chat-desktop-shell {
    width: 100%;
    display: flex;
    flex-direction: column;
    /* Mobile: header + tight chat padding + bottom nav. Shell owns the viewport; messages flex-fill. */
    height: calc(100dvh - 6.5rem);
    min-height: 30rem;
    max-height: calc(100dvh - 6.5rem);
    gap: 0;
}

/* Wrapper owns flex height so floating chrome survives chatMessages.innerHTML clears. */
.chat-messages-pane {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Free-chat Operate header: identity left, session actions right.
   Mission/roleplay overlay the config icon so briefing bars keep the top row. */
.chat-thread-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-shrink: 0;
    min-height: 2.75rem;
    padding: 0.375rem 0.75rem 0.375rem 0.875rem;
    background: var(--teacher-card);
    border-bottom: 1px solid var(--teacher-border);
}

.chat-thread-identity {
    min-width: 0;
    flex: 1 1 auto;
}

.chat-thread-title {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--teacher-text);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-thread-subtitle {
    margin-top: 0.125rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--teacher-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-thread-actions {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.chat-thread-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    border: 0;
    background: transparent;
    color: var(--teacher-text-secondary);
    flex-shrink: 0;
    transition: background-color 140ms ease, color 140ms ease;
}

.chat-thread-icon-btn i {
    font-size: 0.875rem;
    line-height: 1;
}

.chat-thread-icon-btn:hover {
    background: var(--teacher-surface-hover);
    color: var(--teacher-text);
}

.chat-thread-icon-btn:focus {
    outline: none;
}

.chat-thread-icon-btn:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

.chat-thread-call-btn {
    color: var(--teacher-primary);
}

.chat-thread-call-btn:hover {
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
}

#chatLiveCallBtn.hidden,
#chatPage.is-learning-mission #chatLiveCallBtn,
#chatPage.is-roleplay #chatLiveCallBtn {
    display: none !important;
}

#chatPage.is-learning-mission [data-chat-header="free-only"],
#chatPage.is-roleplay [data-chat-header="free-only"] {
    display: none !important;
}

#chatPage.is-learning-mission .chat-thread-header,
#chatPage.is-roleplay .chat-thread-header {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    min-height: 0;
    padding: 0;
    background: transparent;
    border-bottom: 0;
    pointer-events: none;
}

#chatPage.is-learning-mission .chat-thread-header > *,
#chatPage.is-roleplay .chat-thread-header > * {
    pointer-events: auto;
}

#chatPage.is-learning-mission .chat-thread-icon-btn,
#chatPage.is-roleplay .chat-thread-icon-btn {
    background: var(--teacher-card);
    border: 1px solid var(--teacher-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#chatPage.is-learning-mission .chat-messages-scroll-wrap > #chatMessages,
#chatPage.is-roleplay .chat-messages-scroll-wrap > #chatMessages {
    padding-top: 3rem;
}

/* Flex-fill scrollport. Tailwind v2 CDN has no arbitrary h-[…] utilities,
   so a prior h-[28rem] class was ignored and the pane collapsed to content (~166px). */
#chatMessages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Conversation-first shell: thread leads; composer is a compact send row. */
#chatPage .chat-desktop-shell {
    padding: 0.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#chatPage #chatComposerRow {
    flex-shrink: 0;
    margin-top: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
    .chat-thread-icon-btn {
        transition: none;
    }
}

#chatPage #chatComposerRow .chat-composer-field {
    min-height: 3rem;
    padding-left: 0.25rem;
    padding-right: 1rem;
    gap: 0.125rem;
    border-color: var(--teacher-border);
    background: var(--teacher-card);
    color: var(--teacher-text);
}

html[data-theme="dark"] #chatPage #chatComposerRow .chat-composer-field {
    background: var(--teacher-surface-muted);
}

#chatPage #chatComposerRow .chat-composer-field:focus-within {
    --tw-ring-color: transparent;
    box-shadow: 0 0 0 2px var(--teacher-primary-soft);
    border-color: var(--teacher-primary);
}

/* Beat the global dark textarea well so the pill is one surface. */
#chatPage #chatInput,
#chatPage #chatComposerRow textarea {
    background: transparent;
    background-color: transparent;
    border: 0;
    color: var(--teacher-text);
    box-shadow: none;
    caret-color: var(--teacher-primary);
}

#chatPage #chatInput:focus,
#chatPage #chatComposerRow textarea:focus {
    outline: none;
    background: transparent;
    background-color: transparent;
    box-shadow: none;
}

#chatPage #chatInput::placeholder {
    color: var(--teacher-text-secondary);
    opacity: 1;
}

#chatPage #chatInput::selection {
    background: var(--teacher-primary-soft);
    color: var(--teacher-text);
}

#chatPage #chatRecordBtn,
#chatPage .chat-composer-mic {
    width: 3rem;
    height: 3rem;
}

#chatPage #chatRecordBtn i,
#chatPage .chat-composer-mic i {
    font-size: 0.9375rem;
    line-height: 1;
}

#chatPage #chatRecordBtn.bg-blue-600 {
    background: var(--teacher-primary);
}

#chatPage #chatRecordBtn.bg-blue-600:hover {
    background: var(--teacher-primary-dark);
}

#chatPage #chatRecordBtn:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

#chatPage .chat-suggest-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: var(--teacher-text-secondary);
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}

#chatPage .chat-suggest-toggle i {
    font-size: 0.9375rem;
    line-height: 1;
}

#chatPage .chat-suggest-toggle:hover {
    color: var(--teacher-text);
    background: var(--teacher-surface-hover);
}

#chatPage .chat-suggest-toggle.is-active,
#chatPage .chat-suggest-toggle[aria-pressed="true"] {
    color: var(--teacher-amber);
    background: transparent;
}

#chatPage .chat-suggest-toggle.is-active:hover,
#chatPage .chat-suggest-toggle[aria-pressed="true"]:hover {
    color: var(--teacher-amber);
    background: rgba(239, 159, 39, 0.14);
}

#chatPage .chat-suggest-toggle:focus {
    outline: none;
}

#chatPage .chat-suggest-toggle:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

#chatPage .chat-suggest-toggle:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#chatPage .chat-suggest-toggle[aria-busy="true"] {
    opacity: 0.7;
}

#chatPage .chat-suggestion-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    padding: 0 0.125rem 0.125rem;
}

#chatPage #chatAudioVisualization.recording {
    flex-shrink: 0;
}

#chatPage #chatComposerRow:has(#chatAudioVisualization.recording) .chat-suggestion-panel:not(.hidden) {
    max-height: min(36vh, 14.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--teacher-border-strong) transparent;
    scrollbar-width: thin;
}

#chatPage .chat-suggestion-panel.hidden {
    display: none;
}

#chatPage .chat-suggestion-heading {
    margin: 0;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--teacher-text-secondary);
}

#chatPage .chat-suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

#chatPage .chat-suggestion-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    width: 100%;
    padding: 0.375rem 0.5rem 0.375rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--teacher-border);
    background: var(--teacher-surface-muted);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#chatPage .chat-suggestion-phrase {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0.25rem 0;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--teacher-text);
    cursor: pointer;
}

#chatPage .chat-suggestion-phrase:hover {
    color: var(--teacher-primary-dark);
}

#chatPage .chat-suggestion-use {
    flex: 0 0 auto;
    min-width: 2.75rem;
    min-height: 2.25rem;
    margin: 0;
    padding: 0.5rem 0.5rem;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    color: var(--teacher-primary);
    cursor: pointer;
}

#chatPage .chat-suggestion-use:hover {
    color: var(--teacher-primary-dark);
    background: var(--teacher-primary-soft);
}

#chatPage .chat-suggestion-phrase:focus,
#chatPage .chat-suggestion-use:focus {
    outline: none;
}

#chatPage .chat-suggestion-phrase:focus-visible,
#chatPage .chat-suggestion-use:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

@keyframes chatSuggestIn {
    from {
        opacity: 0;
        transform: translateY(0.35rem);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

#chatPage .chat-suggestion-panel:not(.hidden) {
    animation: chatSuggestIn 180ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
    #chatPage .chat-suggest-toggle,
    #chatPage .chat-suggestion-use {
        transition: none;
    }

    #chatPage .chat-suggestion-panel:not(.hidden) {
        animation: none;
    }
}

html[data-theme="dark"] #chatPage .chat-suggestion-card {
    background: var(--teacher-surface-hover);
    border-color: var(--teacher-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] #chatPage .chat-suggestion-phrase:hover {
    color: var(--teacher-primary);
}

html[data-theme="dark"] #chatPage .chat-suggestion-use:hover {
    color: var(--teacher-primary);
    background: var(--teacher-primary-soft);
}

html[data-theme="dark"] #chatPage .chat-suggest-toggle.is-active,
html[data-theme="dark"] #chatPage .chat-suggest-toggle[aria-pressed="true"] {
    color: var(--teacher-amber);
    background: transparent;
}

@media (min-width: 640px) {
    #chatPage .chat-desktop-shell {
        padding: 0.75rem;
    }
}

.app-main-shell {
    transition: padding 220ms ease, max-width 220ms ease;
}

/* Chat only: sit the thread near the header. Home/Practice keep py-8. */
body:has(#chatPage:not(.hidden)) .app-main-shell {
    padding-top: 0.375rem;
}

.desktop-nav-btn {
    justify-content: flex-start;
}

@media (min-width: 640px) {
    .home-panel {
        min-height: 16.5rem;
    }

    .home-panel-lg {
        min-height: 21rem;
    }

    .home-desktop-shell {
        min-height: 26rem;
    }

    .chat-desktop-shell {
        height: calc(100dvh - 3.5rem);
        min-height: 34rem;
        max-height: calc(100dvh - 3.5rem);
    }

    body:has(#chatPage:not(.hidden)) .app-main-shell {
        padding-bottom: 0.5rem;
    }
}

@media (min-width: 1024px) {
    body.desktop-sidebar-active {
        background: var(--teacher-bg);
    }

    body.desktop-sidebar-active .app-header {
        display: none;
    }

    body.desktop-sidebar-active .desktop-sidebar {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--teacher-sidebar-width);
        height: 100dvh;
        max-height: 100dvh;
        overflow-x: hidden;
        overflow-y: hidden;
        z-index: 40;
        border-right: 0.5px solid var(--teacher-border);
        border-bottom: 0;
        background: var(--teacher-card);
    }

    body.desktop-sidebar-active .desktop-sidebar > .max-w-7xl {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    body.desktop-sidebar-active .desktop-sidebar > .max-w-7xl > div {
        flex: 1 1 auto;
        min-height: 0;
    }

    body.desktop-sidebar-active .teacher-sidebar-nav {
        flex: 1 1 auto;
        min-height: 0;
        gap: 6px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: transparent transparent;
    }

    body.desktop-sidebar-active .teacher-sidebar-nav:hover,
    body.desktop-sidebar-active .teacher-sidebar-nav:focus-within {
        scrollbar-color: rgba(107, 114, 128, 0.35) transparent;
    }

    body.desktop-sidebar-active .teacher-sidebar-nav::-webkit-scrollbar {
        width: 4px;
    }

    body.desktop-sidebar-active .teacher-sidebar-nav::-webkit-scrollbar-track {
        background: transparent;
    }

    body.desktop-sidebar-active .teacher-sidebar-nav::-webkit-scrollbar-thumb {
        background: transparent;
        border-radius: 999px;
    }

    body.desktop-sidebar-active .teacher-sidebar-nav:hover::-webkit-scrollbar-thumb,
    body.desktop-sidebar-active .teacher-sidebar-nav:focus-within::-webkit-scrollbar-thumb {
        background: rgba(107, 114, 128, 0.35);
    }

    body.desktop-sidebar-active .desktop-nav-btn {
        min-height: 44px;
        padding: 0 14px;
        border-radius: 14px;
        font-size: 15px;
        line-height: 20px;
        flex: 0 0 auto;
    }

    body.desktop-sidebar-active .desktop-nav-btn i {
        width: 16px;
        font-size: 16px;
    }

    body.desktop-sidebar-active .teacher-sidebar-brand {
        padding: 4px 4px 6px;
    }

    body.desktop-sidebar-active .teacher-sidebar-brand-icon {
        width: 48px;
        height: 48px;
        border-radius: 16px;
        font-size: 20px;
    }

    body.desktop-sidebar-active .teacher-sidebar-brand-title {
        font-size: 17px;
        line-height: 22px;
    }

    body.desktop-sidebar-active .teacher-sidebar-stats {
        margin-top: 0;
    }

    body.desktop-sidebar-active .teacher-sidebar-stat-card {
        padding: 10px;
    }

    body.desktop-sidebar-active .teacher-sidebar-stat-value {
        font-size: 28px;
    }

    body.desktop-sidebar-active .teacher-sidebar-profile-reminder {
        padding: 12px;
    }

    body.desktop-sidebar-active .app-main-shell {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        padding-top: 28px;
        padding-left: calc(var(--teacher-sidebar-width) + var(--teacher-sidebar-gap));
        padding-right: var(--teacher-sidebar-gap);
        background: var(--teacher-bg);
    }

    body.desktop-sidebar-active .desktop-sidebar .max-w-7xl {
        max-width: none;
    }

    .home-desktop-shell {
        max-width: 56rem;
        min-height: 28rem;
        margin-left: auto;
        margin-right: auto;
    }

    .chat-desktop-shell {
        max-width: 50rem;
        height: calc(100dvh - 3.5rem);
        min-height: 38rem;
        max-height: calc(100dvh - 3.5rem);
        margin-left: auto;
        margin-right: auto;
    }

    body.desktop-sidebar-active .chat-desktop-shell {
        height: calc(100dvh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    body.desktop-sidebar-active:has(#chatPage:not(.hidden)) .app-main-shell {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .profile-reminder-mobile {
        display: none !important;
    }

    .teacher-sidebar-profile-reminder {
        width: 100%;
        display: none;
        text-align: left;
        border: 1px solid #F3C15A;
        border-radius: 18px;
        background: #FFF7E8;
        padding: 14px 14px 13px;
        color: #B45309;
        transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
    }

    .teacher-sidebar-profile-reminder.is-visible {
        display: block;
    }

    .teacher-sidebar-profile-reminder:hover {
        background: #FFF2D9;
        box-shadow: 0 10px 24px rgba(180, 83, 9, 0.10);
        transform: translateY(-1px);
    }

    .teacher-sidebar-profile-reminder-kicker {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        line-height: 18px;
        font-weight: 700;
    }

    .teacher-sidebar-profile-reminder-copy {
        margin-top: 8px;
        font-size: 13px;
        line-height: 19px;
        font-weight: 500;
    }

    .teacher-sidebar-profile-reminder-cta {
        margin-top: 12px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 14px;
        line-height: 20px;
        font-weight: 700;
    }
}

.desktop-sidebar,
#homePage,
.practice-explorer {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.teacher-sidebar-brand {
    padding: 6px 6px 10px;
    border-radius: 0;
    transition: opacity 0.16s ease;
}

.teacher-sidebar-brand:hover {
    opacity: 0.92;
}

.teacher-sidebar-brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 20px;
    background: #2F6FED;
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.teacher-sidebar-brand-title {
    font-size: 18px;
    line-height: 24px;
    font-weight: 500;
    color: var(--teacher-text);
}

.teacher-sidebar-brand-copy {
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.desktop-nav-btn {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 16px;
    background: var(--teacher-surface-muted);
    color: var(--teacher-text-secondary);
    font-size: 15px;
    line-height: 20px;
    font-weight: 500;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.desktop-nav-btn i {
    width: 18px;
    font-size: 18px;
}

.desktop-nav-btn:hover {
    background: var(--teacher-surface-hover);
    color: var(--teacher-text);
}

.desktop-nav-btn.is-active {
    background: var(--teacher-nav-active);
    color: var(--teacher-text);
    font-weight: 500;
}

.teacher-sidebar-stats {
    margin-top: 8px;
    display: none;
}

@media (min-width: 1024px) {
    .teacher-sidebar-stats {
        display: grid;
        gap: 0.5rem;
    }
}

.teacher-sidebar-stat-card {
    background: var(--teacher-card);
    border: 0.5px solid var(--teacher-border);
    border-radius: 12px;
    padding: 12px;
}

.teacher-sidebar-stat-card.is-clickable {
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.teacher-sidebar-stat-card.is-clickable:hover {
    background: var(--teacher-bg);
}

.teacher-sidebar-stat-card.is-clickable:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

.teacher-sidebar-stat-label {
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: var(--teacher-text);
}

.teacher-sidebar-stat-row {
    margin-top: 8px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--teacher-text);
}

.teacher-sidebar-stat-icon {
    font-size: 18px;
    line-height: 1;
    align-self: center;
}

.teacher-sidebar-stat-icon.streak {
    color: var(--teacher-amber);
}

.teacher-sidebar-stat-icon.pron {
    color: var(--teacher-primary-dark);
}

.teacher-sidebar-stat-icon.saved {
    color: var(--teacher-secondary);
}

.teacher-sidebar-stat-value {
    font-size: 32px;
    line-height: 1;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.teacher-sidebar-stat-suffix {
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.teacher-sidebar-account {
    border-radius: 12px;
    border: 0.5px solid var(--teacher-border);
    background: var(--teacher-card);
    padding: 0;
    transition: background-color 0.16s ease;
}

.teacher-sidebar-account:hover {
    background: var(--teacher-bg);
}

@media (min-width: 1024px) {
    .teacher-sidebar-account {
        padding: 12px;
    }
}

.teacher-sidebar-account-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--teacher-bg);
    color: var(--teacher-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.teacher-sidebar-account-eyebrow {
    font-size: 11px;
    line-height: 15px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.teacher-sidebar-account-title {
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
    color: var(--teacher-text);
}

.teacher-sidebar-profile-reminder {
    display: none;
}

#initialMenuPage {
    position: relative;
}

.home-upsell-gift-button {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 45;
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transform: translate3d(var(--gift-x, 0px), var(--gift-y, 0px), 0);
    transition: transform 0.85s cubic-bezier(0.22, 0.8, 0.2, 1), opacity 0.2s ease;
}

.home-upsell-gift-bubble {
    position: absolute;
    left: 50%;
    top: -18px;
    transform: translate(-50%, -100%);
    max-width: 124px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #111827;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(229, 231, 235, 0.96);
    pointer-events: none;
}

.home-upsell-gift-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.96);
    border-right: 1px solid rgba(229, 231, 235, 0.96);
    border-bottom: 1px solid rgba(229, 231, 235, 0.96);
    transform: translateX(-50%) rotate(45deg);
}

.home-upsell-gift-button.hidden {
    display: none !important;
}

.home-upsell-gift-button-body {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 9999px;
    border: 1px solid rgba(251, 191, 36, 0.5);
    background: radial-gradient(circle at 30% 28%, #FCD34D 0%, #F59E0B 38%, #F97316 100%);
    box-shadow: 0 16px 28px rgba(249, 115, 22, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.home-upsell-gift-button:hover .home-upsell-gift-button-body {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 18px 34px rgba(249, 115, 22, 0.34);
}

.home-upsell-gift-button:hover .home-upsell-gift-bubble {
    transform: translate(-50%, calc(-100% - 1px));
}

.home-upsell-gift-button.is-trial-ready .home-upsell-gift-button-body {
    border: 1px solid rgba(248, 113, 113, 0.48);
    background: radial-gradient(circle at 30% 28%, #FCA5A5 0%, #EF4444 40%, #B91C1C 100%);
    box-shadow: 0 16px 28px rgba(220, 38, 38, 0.28);
}

.home-upsell-gift-button.is-trial-ready:hover .home-upsell-gift-button-body {
    box-shadow: 0 18px 34px rgba(220, 38, 38, 0.34);
}

.home-upsell-gift-button-body::before {
    content: "";
    position: absolute;
    top: 18px;
    right: 0;
    width: 18px;
    height: 5px;
    border-radius: 999px;
    background: #EF4444;
    transform-origin: left center;
    transform: rotate(-28deg);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88) inset;
}

.home-upsell-gift-button-body::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 24px;
    height: 6px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.12);
    filter: blur(1px);
}

.gift-trial-modal-hero {
    background:
        radial-gradient(circle at top center, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0) 46%),
        linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 52%, #FCE7F3 100%);
    border-bottom: 1px solid rgba(251, 191, 36, 0.22);
    padding-bottom: 1.25rem;
}

.gift-trial-modal-panel {
    max-height: min(88vh, 720px);
    display: flex;
    flex-direction: column;
}

.gift-trial-modal-body {
    overflow-y: auto;
}

.plans-modal-panel {
    max-height: min(88vh, 720px);
    display: flex;
    flex-direction: column;
}

.plans-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.upsell-modal-hero {
    background:
        radial-gradient(circle at top center, rgba(255,255,255,0.78) 0%, rgba(255,255,255,0) 52%),
        linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 45%, #FEF3C7 100%);
    border-bottom: 1px solid rgba(79, 70, 229, 0.14);
}

.teacher-upsell-popup {
    padding: 0 !important;
    border-radius: 24px !important;
    overflow: hidden;
    width: min(520px, calc(100vw - 24px));
}

.teacher-upsell-popup .swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
}

.teacher-upsell-popup .swal2-actions.teacher-upsell-actions {
    margin: 0 !important;
    padding: 16px !important;
    flex-direction: column;
    width: 100%;
    background: var(--teacher-card);
    border-top: 1px solid var(--teacher-border);
}

.teacher-upsell-popup .swal2-actions.teacher-upsell-actions > button {
    margin: 0 !important;
}

.teacher-upsell-plan {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-radius: 16px;
    border: 2px solid var(--teacher-border-strong);
    background: var(--teacher-card);
    padding: 12px;
}

.teacher-upsell-plan.is-highlight {
    border-color: rgba(79, 70, 229, 0.65);
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.10);
}

.teacher-upsell-plan-title {
    font-size: 14px;
    line-height: 20px;
    font-weight: 800;
    color: var(--teacher-text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.teacher-upsell-plan-sub {
    margin-top: 2px;
    font-size: 12px;
    line-height: 18px;
    font-weight: 600;
    color: rgba(107, 114, 128, 1);
}

.teacher-upsell-plan-price {
    font-size: 14px;
    line-height: 20px;
    font-weight: 900;
    color: rgba(17, 24, 39, 0.96);
    white-space: nowrap;
    text-align: right;
}

.teacher-upsell-plan-savings {
    margin-top: 2px;
    font-size: 12px;
    line-height: 18px;
    font-weight: 800;
    color: rgba(5, 150, 105, 1);
    text-align: right;
}

.teacher-upsell-save-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #EC4899 0%, #7C3AED 100%);
    color: #FFFFFF;
    font-size: 11px;
    line-height: 22px;
    font-weight: 900;
    letter-spacing: 0.02em;
    box-shadow: 0 12px 22px rgba(124, 58, 237, 0.18);
}

.teacher-upsell-badge {
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 1);
    color: #FFFFFF;
    font-size: 11px;
    line-height: 22px;
    font-weight: 800;
}

.home-upsell-gift-button-wave {
    position: absolute;
    top: 8px;
    right: -7px;
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    background: #FFFFFF;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    transform-origin: 20% 80%;
    animation: homeGiftWave 3.4s ease-in-out infinite;
}

.home-upsell-gift-button-icon {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.home-upsell-gift-button-icon::before,
.home-upsell-gift-button-icon::after {
    content: "";
    position: absolute;
    bottom: -10px;
    width: 3px;
    height: 13px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(120, 53, 15, 0.9), rgba(120, 53, 15, 0.72));
    transform-origin: top center;
    opacity: 0.88;
    box-shadow: 0 10px 0 -3px rgba(120, 53, 15, 0.92);
}

.home-upsell-gift-button-icon::before {
    left: 12px;
    transform: rotate(12deg);
}

.home-upsell-gift-button-icon::after {
    right: 12px;
    transform: rotate(-12deg);
}

.home-upsell-gift-ribbon-v,
.home-upsell-gift-ribbon-h {
    position: absolute;
    background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%);
    border-radius: 999px;
}

.home-upsell-gift-ribbon-v {
    top: -1px;
    bottom: -1px;
    left: 50%;
    width: 8px;
    transform: translateX(-50%);
}

.home-upsell-gift-ribbon-h {
    left: -1px;
    right: -1px;
    top: 12px;
    height: 8px;
}

.home-upsell-gift-face {
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 24px;
    height: 13px;
    transform: translateX(-50%);
}

.home-upsell-gift-eye {
    position: absolute;
    top: 1px;
    width: 4px;
    height: 6px;
    border-radius: 999px;
    background: #111827;
}

.home-upsell-gift-eye:first-child {
    left: 4px;
}

.home-upsell-gift-eye:nth-child(2) {
    right: 4px;
}

.home-upsell-gift-smile {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 12px;
    height: 7px;
    border: 2px solid #111827;
    border-top: 0;
    border-left-color: transparent;
    border-right-color: transparent;
    border-bottom-left-radius: 999px;
    border-bottom-right-radius: 999px;
    transform: translateX(-50%);
}

.home-upsell-gift-button.is-running .home-upsell-gift-button-body {
    animation: homeGiftRunHop 1.1s ease-in-out;
}

.home-upsell-gift-button.is-running .home-upsell-gift-button-body::before {
    animation: homeGiftArmRun 0.26s ease-in-out 4;
}

.home-upsell-gift-button.is-running .home-upsell-gift-button-icon::before {
    animation: homeGiftLegLeft 0.24s ease-in-out 4;
}

.home-upsell-gift-button.is-running .home-upsell-gift-button-icon::after {
    animation: homeGiftLegRight 0.24s ease-in-out 4;
}

.home-upsell-gift-button.is-running .home-upsell-gift-button-wave {
    animation: homeGiftWaveRun 0.5s ease-in-out 2;
}

.home-upsell-gift-button.is-running .home-upsell-gift-bubble {
    animation: homeGiftBubbleFloat 1.15s ease-in-out;
}

.home-upsell-gift-button.is-celebrating .home-upsell-gift-button-body {
    animation: homeGiftCelebrate 0.8s ease-out;
}

.home-upsell-gift-button.is-celebrating .home-upsell-gift-bubble {
    animation: homeGiftBubbleCelebrate 0.8s ease-out;
}

.gift-confetti-piece {
    position: fixed;
    left: var(--confetti-x, 0px);
    top: var(--confetti-y, 0px);
    width: 8px;
    height: 14px;
    border-radius: 2px;
    background: var(--confetti-color, #F59E0B);
    pointer-events: none;
    z-index: 110;
    opacity: 0.98;
    transform: translate(-50%, -50%) rotate(var(--confetti-rotate, 0deg));
    animation: giftConfettiBurst 1s ease-out forwards;
}

@keyframes homeGiftRunHop {
    0% { transform: translateY(0) rotate(0deg) scale(1); }
    20% { transform: translateY(-6px) rotate(-5deg) scale(1.02); }
    45% { transform: translateY(-1px) rotate(5deg) scale(1.03); }
    70% { transform: translateY(-5px) rotate(-4deg) scale(1.02); }
    100% { transform: translateY(0) rotate(0deg) scale(1); }
}

@keyframes homeGiftWave {
    0%, 72%, 100% { transform: rotate(0deg); }
    76% { transform: rotate(16deg); }
    82% { transform: rotate(-10deg); }
    88% { transform: rotate(14deg); }
    94% { transform: rotate(-6deg); }
}

@keyframes homeGiftArmRun {
    0%, 100% { transform: rotate(-30deg); }
    50% { transform: rotate(18deg); }
}

@keyframes homeGiftWaveRun {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(18deg) scale(1.04); }
    50% { transform: rotate(-12deg) scale(0.98); }
    75% { transform: rotate(14deg) scale(1.04); }
}

@keyframes homeGiftBubbleFloat {
    0%, 100% { transform: translate(-50%, -100%); }
    40% { transform: translate(-50%, calc(-100% - 6px)); }
}

@keyframes homeGiftCelebrate {
    0% { transform: translateY(0) scale(1); }
    20% { transform: translateY(-8px) scale(1.05) rotate(-6deg); }
    45% { transform: translateY(-2px) scale(1.08) rotate(6deg); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes homeGiftBubbleCelebrate {
    0% { transform: translate(-50%, -100%) scale(1); opacity: 1; }
    35% { transform: translate(-50%, calc(-100% - 8px)) scale(1.06); opacity: 1; }
    100% { transform: translate(-50%, -100%) scale(1); opacity: 1; }
}

@keyframes homeGiftLegLeft {
    0%, 100% { transform: rotate(24deg); }
    50% { transform: rotate(-30deg); }
}

@keyframes homeGiftLegRight {
    0%, 100% { transform: rotate(-24deg); }
    50% { transform: rotate(30deg); }
}

@keyframes giftConfettiBurst {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--confetti-rotate, 0deg)) scale(1);
    }
    100% {
        opacity: 0;
        transform:
            translate(calc(-50% + var(--confetti-dx, 0px)), calc(-50% + var(--confetti-dy, 0px)))
            rotate(calc(var(--confetti-rotate, 0deg) + 220deg))
            scale(0.8);
    }
}

.profile-reminder-mobile {
    display: none;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    border: 1px solid #F3B3B3;
    border-radius: 20px;
    background: #FFFFFF;
    padding: 16px 16px 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.profile-reminder-mobile.is-visible {
    display: flex;
}

.profile-reminder-mobile-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #FFF1F1;
    color: #FF5A5F;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-reminder-mobile-main {
    min-width: 0;
    flex: 1;
    text-align: left;
}

.profile-reminder-mobile-title {
    font-size: 16px;
    line-height: 22px;
    font-weight: 700;
    color: #171717;
}

.profile-reminder-mobile-copy {
    margin-top: 2px;
    font-size: 14px;
    line-height: 22px;
    color: #475569;
}

.profile-reminder-mobile-cta {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 700;
    color: #EF4444;
}

.profile-reminder-mobile-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    color: #94A3B8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-reminder-mobile-close:hover {
    background: #F8FAFC;
}

.unit-img {
    transition: width 320ms ease-in-out, height 320ms ease-in-out, box-shadow 320ms ease-in-out;
}

.unit-card.is-zoomed .unit-card-header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.unit-card.is-zoomed .unit-img-zoom-btn {
    margin: 8px auto 0;
}

.unit-card.is-zoomed .unit-img {
    width: clamp(140px, 40vw, 240px);
    height: clamp(140px, 40vw, 240px);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.15);
}

.practice-goals-panel {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.practice-panel-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.practice-panel-kicker {
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.practice-panel-title {
    font-size: 24px;
    line-height: 30px;
    font-weight: 500;
    color: var(--teacher-text);
}

.practice-panel-copy {
    max-width: 42rem;
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.practice-goals-grid {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    overflow-x: auto;
    padding: 0 2px 2px;
    scroll-snap-type: x proximity;
}

.practice-scroll-shell {
    position: relative;
}

.practice-scroll-shell::before,
.practice-scroll-shell::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0.35rem;
    width: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 2;
}

.practice-scroll-shell::before {
    left: 0;
    background: linear-gradient(90deg, var(--teacher-bg) 0%, transparent 100%);
}

.practice-scroll-shell::after {
    right: 0;
    background: linear-gradient(270deg, var(--teacher-bg) 0%, transparent 100%);
}

.practice-scroll-shell.can-scroll-left::before,
.practice-scroll-shell.can-scroll-right::after {
    opacity: 1;
}

.practice-scroll-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    border: 1px solid var(--teacher-border);
    background: var(--teacher-card);
    color: var(--teacher-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, background-color 0.18s ease;
    z-index: 3;
}

.practice-scroll-hint:hover {
    background: var(--teacher-surface-hover);
}

.practice-scroll-hint.is-left {
    left: 4px;
}

.practice-scroll-hint.is-right {
    right: 4px;
}

.practice-scroll-shell.can-scroll-left .practice-scroll-hint.is-left,
.practice-scroll-shell.can-scroll-right .practice-scroll-hint.is-right {
    opacity: 1;
    pointer-events: auto;
}

.practice-goal-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: auto;
    min-width: 186px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 0.5px solid var(--teacher-border);
    background: var(--teacher-card);
    text-align: left;
    position: relative;
    scroll-snap-align: start;
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.practice-goal-card:hover {
    background: #FCFCFD;
    border-color: rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.practice-goal-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    background: var(--teacher-secondary-soft);
    color: var(--teacher-secondary);
}

.practice-goal-title {
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    color: var(--teacher-text);
}

.practice-goal-title-short {
    display: none;
}

.practice-goal-count {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-top: 6px;
    padding: 2px 7px;
    border-radius: 9999px;
    font-size: 10px;
    line-height: 14px;
    font-weight: 500;
    white-space: nowrap;
    background: var(--teacher-surface-muted);
    color: var(--teacher-text-secondary);
}

.practice-goal-subtitle {
    margin-top: 4px;
    font-size: 11px;
    line-height: 16px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.practice-goal-card.is-active {
    background: linear-gradient(180deg, rgba(29, 158, 117, 0.10), rgba(29, 158, 117, 0.04));
    border-color: rgba(29, 158, 117, 0.58);
    box-shadow: 0 10px 20px rgba(29, 158, 117, 0.10), 0 0 0 1px rgba(29, 158, 117, 0.12);
}

.practice-goal-card.is-active .practice-goal-icon {
    background: var(--teacher-primary);
    color: #FFFFFF;
}

.practice-goal-card.is-active .practice-goal-count {
    background: rgba(29, 158, 117, 0.10);
    color: var(--teacher-primary-dark);
}

.practice-goal-card.is-active::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: #1D9E75;
    box-shadow: 0 0 0 4px rgba(29, 158, 117, 0.14);
}

.practice-categories-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 14px;
    overflow-x: auto;
    padding: 0 2px 2px;
    scroll-snap-type: x proximity;
}

.practice-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 12px;
    border-radius: 9999px;
    border: 0.5px solid var(--teacher-border);
    background: #FFFFFF;
    color: #4B5563;
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    scroll-snap-align: start;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.practice-category-chip:hover {
    background: var(--teacher-bg);
    color: var(--teacher-text);
    transform: translateY(-1px);
}

.practice-category-chip.is-active {
    background: #0F172A;
    border-color: #0F172A;
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.14);
}

.practice-category-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 9999px;
    background: #E5E7EB;
    color: #111827;
    border: 1px solid rgba(17, 24, 39, 0.06);
    font-size: 10px;
    line-height: 14px;
    font-weight: 700;
}

.practice-category-chip.is-active .practice-category-chip-count {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.16);
}

.practice-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.practice-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.practice-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.practice-section-title {
    font-size: 20px;
    line-height: 26px;
    font-weight: 500;
    color: var(--teacher-text);
}

.practice-section-subtitle {
    margin-top: 2px;
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.practice-unit-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.practice-unit-card {
    border: 0.5px solid var(--teacher-border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--teacher-card);
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
    cursor: pointer;
}

.practice-unit-card:hover {
    border-color: rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.practice-unit-media {
    position: relative;
    min-height: 196px;
    background: #0f172a;
}

.practice-unit-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.practice-unit-media-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.72)),
        linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.02));
}

.practice-unit-media-top,
.practice-unit-media-copy {
    position: relative;
    z-index: 1;
}

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

.practice-unit-media-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 16px 16px;
}

.practice-unit-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 6px;
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 11px;
    line-height: 14px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.practice-unit-badge + .practice-unit-badge {
    margin-left: 2px;
}

.practice-unit-badge-pro {
    border-color: rgba(251, 191, 36, 0.38);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.96), rgba(245, 158, 11, 0.92));
    color: #111827;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.28);
}

.practice-unit-title {
    font-size: 18px;
    line-height: 24px;
    font-weight: 500;
    color: #fff;
}

.practice-unit-subtitle {
    margin-top: 4px;
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
}

.practice-unit-body {
    padding: 18px 18px 16px;
}

.practice-unit-description {
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.practice-unit-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.practice-level-pill,
.practice-progress-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
}

.practice-level-beginner {
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
}

.practice-level-intermediate {
    background: rgba(239, 159, 39, 0.18);
    color: #854F0B;
}

.practice-level-advanced {
    background: var(--teacher-secondary-soft);
    color: var(--teacher-secondary);
}

.practice-progress-pill {
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
}

.practice-progress-pill.is-done {
    background: var(--teacher-secondary-soft);
    color: var(--teacher-secondary);
}

.practice-unit-meta-text {
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.practice-topic-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 14px;
}

.practice-topic-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 0;
    background: var(--teacher-bg);
    color: var(--teacher-text);
    transition: background-color 0.16s ease, transform 0.16s ease;
}

.practice-topic-pill:hover {
    background: var(--teacher-surface-hover);
    transform: translateY(-1px);
}

.practice-topic-pill.is-locked {
    opacity: 0.75;
}

.practice-topic-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.practice-topic-meta {
    flex-shrink: 0;
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
    padding-left: 8px;
}

.practice-topic-meta.is-pro {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #FDE68A, #F59E0B);
    color: #111827;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.22);
}

.practice-unit-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
    padding-top: 2px;
}

.practice-progress-block {
    flex: 1;
}

.practice-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: var(--teacher-text);
}

.practice-progress-bar {
    width: 100%;
    height: 4px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: 9999px;
    background: #E5E7EB;
}

.practice-progress-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--teacher-primary);
}

.practice-unit-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.practice-unit-xp {
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.practice-unit-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9999px;
    background: #111111;
    color: #fff;
    padding: 10px 20px;
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
}

.practice-unit-button.is-secondary {
    background: #fff;
    color: #111827;
    border: 1px solid #E5E7EB;
}

.practice-unit-button i,
.practice-banner-button i {
    font-size: 15px;
}

.practice-accent-survival {
    background: #FFF4E8;
    color: #A04B00;
}

.practice-accent-life {
    background: #EEF1F8;
    color: #455468;
}

.practice-accent-work {
    background: #FAEEDA;
    color: #854F0B;
}

.practice-accent-travel {
    background: #EAF5FF;
    color: #1B67B2;
}

.practice-accent-social {
    background: #FBEAF4;
    color: #9B2C68;
}

.practice-accent-health {
    background: #E8F8F0;
    color: #13795B;
}

.practice-accent-technology {
    background: #EEEDFE;
    color: #534AB7;
}

.practice-accent-citizenship {
    background: #F1EEFE;
    color: #6750A4;
}

.practice-topic-icon-tone-default {
    color: var(--teacher-primary);
}

.practice-topic-icon-tone-info {
    color: #1B67B2;
}

.practice-topic-icon-tone-success {
    color: var(--teacher-primary);
}

.practice-topic-icon-tone-social {
    color: #9B2C68;
}

.practice-topic-icon-tone-warning {
    color: #854F0B;
}

.practice-topic-icon-tone-purple {
    color: var(--teacher-secondary);
}

.practice-topic-icon-tone-neutral {
    color: #455468;
}

.practice-topic-icon-tone-danger {
    color: #C2410C;
}

.practice-topic-icon-tone-done {
    color: var(--teacher-primary);
}

.practice-page-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.practice-page-kicker {
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.practice-page-title {
    font-size: 28px;
    line-height: 34px;
    font-weight: 500;
    color: var(--teacher-text);
}

.practice-page-copy {
    font-size: 13px;
    line-height: 20px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
    max-width: 44rem;
}

/* Practice catalog explorer — search + chips + lean units */
.practice-explorer {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.practice-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 0.15rem 0 0.35rem;
    background: linear-gradient(180deg, var(--teacher-bg, #f8fafc) 70%, rgba(248, 250, 252, 0));
}

.practice-search-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.practice-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0 0.9rem;
    border-radius: 0.9rem;
    border: 1px solid var(--teacher-border, #e5e7eb);
    background: var(--teacher-card, #fff);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    color: var(--teacher-text-secondary, #64748b);
}

.practice-free-mode-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    min-height: 2.75rem;
    padding: 0 0.85rem;
    border: 0;
    border-radius: 0.9rem;
    background: transparent;
    color: var(--teacher-primary-dark, #0f766e);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 140ms ease, background-color 140ms ease;
}

.practice-free-mode-link:hover {
    color: var(--teacher-primary, #0d9488);
    background: rgba(29, 158, 117, 0.08);
}

.practice-free-mode-link:focus-visible {
    outline: 2px solid var(--teacher-primary-dark, #0f766e);
    outline-offset: 2px;
}

.practice-free-mode-link i {
    font-size: 1rem;
}

.practice-search i {
    font-size: 1.05rem;
    flex: 0 0 auto;
}

.practice-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--teacher-text, #0f172a);
    font-size: 0.9375rem;
    line-height: 1.4;
    outline: none;
}

.practice-search input::placeholder {
    color: #94a3b8;
}

.practice-search:focus-within {
    border-color: rgba(47, 111, 237, 0.45);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

.practice-filter-row {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.1rem 0.15rem 0.35rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.practice-filter-row::-webkit-scrollbar {
    display: none;
}

.practice-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    min-height: 2.15rem;
    padding: 0 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--teacher-border, #e5e7eb);
    background: var(--teacher-card, #fff);
    color: var(--teacher-text, #334155);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    scroll-snap-align: start;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.practice-filter-chip i {
    font-size: 0.95rem;
    opacity: 0.85;
}

.practice-filter-chip-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.practice-filter-chip:hover {
    border-color: rgba(47, 111, 237, 0.35);
    background: var(--teacher-surface-muted);
}

.practice-filter-chip.is-active {
    border-color: transparent;
    background: #2F6FED;
    color: #fff;
}

.practice-filter-chip.is-active .practice-filter-chip-count {
    color: rgba(255, 255, 255, 0.85);
}

.practice-filter-row--levels {
    margin-top: 0.15rem;
}

.practice-filter-chip--level {
    background: var(--teacher-surface-muted);
}

.practice-filter-chip--level.is-active {
    background: var(--teacher-text);
    border-color: transparent;
    color: var(--teacher-card);
}

.practice-filter-chip--level.is-active .practice-filter-chip-count {
    color: rgba(255, 255, 255, 0.8);
}

.practice-filter-chip:focus {
    outline: none;
}

.practice-filter-chip:focus-visible {
    box-shadow: 0 0 0 2px var(--teacher-card), 0 0 0 4px #2F6FED;
}

.practice-catalog-open {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.practice-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.practice-section-head {
    margin-top: 0.35rem;
}

.practice-unit-grid-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .practice-unit-grid-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.1rem;
    }
}

@media (min-width: 1100px) {
    .practice-unit-grid-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

.practice-unit-card--tile {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border: 1px solid var(--teacher-border, #e5e7eb);
    border-radius: 1.15rem;
    background: var(--teacher-card, #fff);
    overflow: hidden;
    cursor: default;
    transition: border-color 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.practice-unit-card--tile:hover {
    border-color: rgba(47, 111, 237, 0.32);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
}

.practice-unit-card--tile.is-locked {
    opacity: 0.94;
}

.practice-unit-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #e2e8f0;
    overflow: hidden;
}

.practice-unit-cover-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.practice-unit-cover-fade {
    position: absolute;
    inset: auto 0 0 0;
    height: 42%;
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.45));
    pointer-events: none;
}

.practice-unit-cover-badges {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    right: 0.7rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    z-index: 1;
}

.practice-unit-card--tile .practice-unit-badge-pro {
    display: inline-flex;
    align-items: center;
    min-height: 1.35rem;
    padding: 0 0.45rem;
    border-radius: 0.45rem;
    border: 0;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.68rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.practice-unit-tile-body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1;
    padding: 0.95rem 1rem 1.05rem;
    min-width: 0;
}

.practice-unit-tile-title {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.28;
    font-weight: 700;
    color: var(--teacher-text, #0f172a);
    letter-spacing: -0.015em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.practice-unit-progress {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.5rem;
}

.practice-unit-progress-track {
    height: 0.28rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.practice-unit-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #2F6FED;
}

.practice-unit-progress-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.practice-topic-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    margin-top: 0.15rem;
}

.practice-topic-block-label {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--teacher-text-secondary);
}

.practice-topic-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.practice-topic-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.15rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--teacher-border-strong);
    border-radius: 0.65rem;
    background: var(--teacher-surface-muted);
    color: var(--teacher-text);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.practice-topic-link:hover {
    background: rgba(47, 111, 237, 0.12);
    border-color: rgba(47, 111, 237, 0.45);
    color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(47, 111, 237, 0.1);
}

.practice-topic-link:hover .practice-topic-link-label {
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.practice-topic-link:hover .practice-topic-link-chevron {
    transform: translateX(2px);
    color: #1d4ed8;
}

.practice-topic-link:focus {
    outline: none;
}

.practice-topic-link:focus-visible {
    box-shadow: 0 0 0 2px var(--teacher-card), 0 0 0 4px #2F6FED;
}

.practice-topic-link.is-done {
    border-color: rgba(15, 118, 110, 0.32);
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
}

.practice-topic-link.is-progress {
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.07);
    color: #1e3a8a;
}

.practice-topic-link.is-locked {
    color: var(--teacher-text-secondary);
}

.practice-topic-link-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.practice-topic-link-chevron {
    color: var(--teacher-text-secondary);
    font-size: 0.95rem;
    transition: transform 160ms ease, color 160ms ease;
}

.practice-topic-status {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex: 0 0 auto;
    min-height: 1.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.practice-topic-status--done {
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
}

.practice-topic-status--progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.practice-topic-link-pro {
    font-size: 0.62rem;
    font-weight: 800;
    color: #b45309;
    background: #fef3c7;
    border-radius: 0.35rem;
    padding: 0.1rem 0.35rem;
}

.practice-topic-more {
    appearance: none;
    display: inline-flex;
    align-items: center;
    align-self: start;
    gap: 0.2rem;
    margin: 0;
    padding: 0.15rem 0.2rem;
    min-height: 2rem;
    border: 0;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--teacher-primary-dark);
    cursor: pointer;
    text-align: left;
}

.practice-topic-more:hover {
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.practice-topic-more:focus {
    outline: none;
}

.practice-topic-more:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
    border-radius: 0.35rem;
}

.practice-topic-more[aria-expanded="true"] {
    color: var(--teacher-text-secondary);
}

.practice-topic-more i {
    font-size: 0.85rem;
    transition: transform 160ms ease;
}

.practice-topic-more[aria-expanded="true"] i {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .practice-scroll-shell::before,
    .practice-scroll-shell::after,
    .practice-scroll-hint,
    .practice-topic-more i {
        transition: none;
    }
}

.practice-unit-card--tile .practice-unit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin-top: auto;
}

.practice-unit-card--tile .practice-unit-button--ghost,
.practice-unit-card--tile .practice-unit-button--block {
    min-height: 2.45rem;
    justify-content: center;
    padding: 0 0.7rem;
    border-radius: 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.practice-unit-card--tile .practice-unit-button--ghost {
    border: 1px solid var(--teacher-border-strong);
    background: var(--teacher-card);
    color: var(--teacher-text);
}

.practice-unit-card--tile .practice-unit-button--ghost:hover {
    border-color: rgba(47, 111, 237, 0.45);
    background: var(--teacher-surface-muted);
    color: #1d4ed8;
}

.practice-unit-card--tile .practice-unit-button--block {
    border: 0;
    background: #2F6FED;
    color: #fff;
}

.practice-unit-card--tile .practice-unit-button--block:hover {
    background: #1d4ed8;
}

.practice-unit-card--tile .practice-unit-button--ghost:focus-visible,
.practice-unit-card--tile .practice-unit-button--block:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

@media (max-width: 420px) {
    .practice-unit-card--tile .practice-unit-actions {
        grid-template-columns: 1fr;
    }
}

.practice-unit-lean-empty,
.practice-empty-state {
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.875rem;
}

.practice-unit-lean-empty {
    padding: 0.2rem 0;
    border: 0;
    background: transparent;
    list-style: none;
}

.practice-next-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border: 1px solid rgba(29, 158, 117, 0.24);
    border-radius: 20px;
    background: linear-gradient(135deg, var(--teacher-primary-soft), var(--teacher-card) 72%);
}

.practice-next-step h3 {
    color: var(--teacher-text);
    font-size: 20px;
    line-height: 26px;
    font-weight: 700;
}

.practice-next-step p {
    margin-top: 4px;
    color: var(--teacher-text);
    font-size: 13px;
    line-height: 19px;
}

.practice-next-step-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--teacher-primary-dark);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.practice-next-step-button:focus-visible {
    outline: 2px solid var(--teacher-primary-dark);
    outline-offset: 2px;
}

.practice-catalog {
    overflow: hidden;
    border: 1px solid var(--teacher-border);
    border-radius: 18px;
    background: var(--teacher-card);
}

.practice-catalog summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 16px;
    color: var(--teacher-text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    list-style: none;
}

.practice-catalog summary::-webkit-details-marker {
    display: none;
}

.practice-catalog[open] summary {
    border-bottom: 1px solid var(--teacher-border);
}

.practice-catalog summary i {
    color: var(--teacher-text-secondary);
    transition: transform 160ms ease;
}

.practice-catalog[open] summary i {
    transform: rotate(180deg);
}

.practice-catalog-content {
    padding: 16px;
}

@media (max-width: 767px) {
    .practice-search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }

    .practice-free-mode-link {
        align-self: flex-start;
        min-height: 2.25rem;
        padding: 0 0.15rem;
    }

    .practice-next-step {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
        padding: 16px;
    }

    .practice-next-step-button {
        width: 100%;
    }
}

.practice-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.practice-banner {
    border-radius: 16px;
    overflow: hidden;
    background: var(--teacher-card);
    border: 0.5px solid var(--teacher-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.practice-banner-primary {
    border-color: rgba(29, 158, 117, 0.26);
    background:
        linear-gradient(180deg, rgba(29, 158, 117, 0.08), rgba(29, 158, 117, 0.03)),
        var(--teacher-card);
}

.practice-banner-secondary {
    border-color: rgba(79, 70, 229, 0.22);
    background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.11), rgba(99, 102, 241, 0.05)),
        var(--teacher-card);
}

.practice-banner-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
}

.practice-banner-copy {
    min-width: 0;
    flex: 1;
}

.practice-banner-eyebrow {
    font-size: 11px;
    line-height: 14px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.practice-banner-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
    color: var(--teacher-text);
}

.practice-banner-icon-box {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.practice-banner-icon-box.secondary {
    background: var(--teacher-secondary-soft);
    color: var(--teacher-secondary);
}

.practice-banner-text {
    margin-top: 5px;
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    color: var(--teacher-text-secondary);
}

.practice-banner-image {
    display: none;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 14px;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    background: #F5F6FA;
}

.practice-banner-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    border-radius: 999px;
    background: #111111;
    color: #FFFFFF;
    height: 34px;
    box-sizing: border-box;
    border: 0.5px solid transparent;
    appearance: none;
    padding: 0 12px;
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    white-space: nowrap;
}

.practice-banner-button.secondary {
    background: #312E81;
    color: #FFFFFF;
    border: 0.5px solid #312E81;
}

.practice-count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 9999px;
    background: var(--teacher-secondary);
    color: #fff;
    font-size: 10px;
    line-height: 14px;
    font-weight: 500;
}

@media (min-width: 768px) {
    .practice-goals-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        padding: 0;
    }

    .practice-unit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .practice-mode-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        margin-bottom: 24px;
    }

    .practice-goal-card {
        width: 100%;
        min-width: 0;
        align-items: flex-start;
        padding: 14px 16px;
    }

    .practice-goal-subtitle {
        display: block;
    }

    .practice-banner-inner {
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 18px;
        padding: 18px 20px;
    }

    .practice-categories-row {
        padding: 0 0 6px;
        scrollbar-width: thin;
        scrollbar-color: rgba(148, 163, 184, 0.9) transparent;
    }

    .practice-categories-row::-webkit-scrollbar {
        height: 8px;
    }

    .practice-categories-row::-webkit-scrollbar-track {
        background: transparent;
    }

    .practice-categories-row::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.8);
        border-radius: 9999px;
    }

    .practice-banner-image {
        display: block;
    }
}

@media (min-width: 1280px) {
    .practice-unit-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .profile-modal-scroll {
        max-height: 68vh !important;
        padding-right: 0 !important;
    }

    .profile-context-preset-group {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .profile-context-preset-card {
        padding: 12px !important;
        gap: 10px !important;
        border-radius: 16px !important;
    }

    .profile-context-preset-card-icon {
        width: 36px !important;
        height: 36px !important;
        border-radius: 12px !important;
        font-size: 17px !important;
    }

    .profile-context-preset-card-title {
        font-size: 12px !important;
        line-height: 17px !important;
    }

    .profile-context-preset-card-description {
        font-size: 11px !important;
        line-height: 15px !important;
    }

    .profile-context-preset-card-keywords {
        margin-top: 6px !important;
        font-size: 10px !important;
        line-height: 13px !important;
    }

    .practice-panel-title,
    .practice-page-title {
        font-size: 21px;
        line-height: 26px;
    }

    .practice-page-copy,
    .practice-panel-copy {
        font-size: 12px;
        line-height: 17px;
    }

    .practice-banner-eyebrow {
        display: none;
    }

    .practice-banner-inner {
        grid-template-columns: 1fr;
        align-items: flex-start;
        gap: 8px;
    }

    .practice-unit-cta {
        flex-wrap: wrap;
    }

    .practice-unit-actions {
        width: 100%;
        justify-content: stretch;
    }

    .practice-unit-actions .practice-unit-button {
        justify-content: center;
        flex: 1 1 180px;
    }

    .practice-banner-button {
        width: auto;
    }

    .practice-goals-grid::-webkit-scrollbar,
    .practice-categories-row::-webkit-scrollbar {
        display: none;
    }

    .practice-goals-grid,
    .practice-categories-row {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .practice-goal-card {
        min-width: 154px;
        padding: 10px 12px;
        gap: 8px;
        border-radius: 999px;
    }

    .practice-goal-icon {
        width: 28px;
        height: 28px;
        border-radius: 999px;
        font-size: 16px;
    }

    .practice-goal-title {
        font-size: 12px;
        line-height: 16px;
    }

    .practice-goal-title-full {
        display: none;
    }

    .practice-goal-title-short {
        display: inline;
    }

    .practice-goal-subtitle {
        display: none;
    }

    .practice-goal-count {
        margin-top: 2px;
        padding: 1px 6px;
        font-size: 9px;
        line-height: 12px;
    }

    .practice-category-chip {
        min-height: 34px;
        padding: 6px 12px;
    }

    .practice-category-chip-count {
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
    }
}

@keyframes waveAnimation {
    0% {
        height: 10px;
    }
    100% {
        height: 40px;
    }
}

/* Delay each bar animation slightly */


/* Highlight effect for correct/incorrect words */
#highlightedReferenceText {
    line-height: 1.6;
}

#highlightedReferenceText span {
    display: inline-block;
    padding: 0 4px;
    margin: 0 1px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#highlightedReferenceText span:hover {
    background-color: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

/* Style for pronunciations with different statuses */
.text-green-600.font-bold {
    background-color: rgba(5, 150, 105, 0.1);
}

.text-red-500.line-through {
    background-color: rgba(239, 68, 68, 0.1);
}

.text-yellow-600 {
    background-color: rgba(245, 158, 11, 0.1);
}

.results-verdict-line,
.results-coach-headline {
    margin: 0.25rem 0 0;
    color: var(--teacher-text);
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.35;
}

.results-phrase {
    margin: 0;
    color: var(--teacher-text);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.55;
}

.results-word {
    display: inline;
}

.results-word.is-sub {
    color: #8A4B00;
    font-weight: 800;
}

.results-word.is-missing {
    color: #9B1C1C;
    text-decoration: line-through;
    font-weight: 800;
}

.results-word.is-extra {
    color: var(--teacher-text-secondary);
    text-decoration: line-through;
    font-weight: 600;
}

html[data-theme="dark"] .results-word.is-sub {
    color: #F3C56B;
}

html[data-theme="dark"] .results-word.is-missing {
    color: #FECACA;
}

html[data-theme="dark"] #resultsPage .results-word.is-correct {
    color: var(--teacher-primary);
    background: transparent;
}

html[data-theme="dark"] #resultsPage .results-word.is-sub {
    color: #F3C56B;
}

html[data-theme="dark"] #resultsPage .results-word.is-missing {
    color: #FECACA;
}

html[data-theme="dark"] #resultsPage .results-listen-btn {
    background: var(--teacher-card);
    color: var(--teacher-text);
}

html[data-theme="dark"] #resultsPage .results-score-cluster:has(.results-score-ring.is-high) {
    background: rgba(62, 207, 142, 0.14);
}
/* Pulse for Next: ink, not success-green */
@keyframes pulse-next-ink {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--teacher-text) 38%, transparent); }
  70% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--teacher-text) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--teacher-text) 0%, transparent); }
}

.pulse-next-button {
  animation: pulse-next-ink 2s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pulse-next-button {
    animation: none;
  }
}

/* Chat bubbles — shared by free chat, roleplay, and learning missions.
   Semantic tokens beat Tailwind bg-blue-100 / text-gray-800, which fight dark theme. */
.chat-bubble {
    color: var(--chat-assistant-ink);
}

.chat-bubble--user {
    background: var(--chat-user-bubble);
    color: var(--chat-user-ink);
}

.chat-bubble--assistant {
    background: var(--chat-assistant-bubble);
    color: var(--chat-assistant-ink);
}

.chat-bubble--user .chat-bubble-role,
.chat-bubble--user .chat-bubble-text {
    color: var(--chat-user-ink);
}

.chat-bubble--assistant .chat-bubble-role,
.chat-bubble--assistant .chat-bubble-text {
    color: var(--chat-assistant-ink);
}

.chat-bubble-avatar--user {
    background: var(--chat-user-avatar);
    color: #fff;
}

/* Shared chat correction panel (free chat, roleplay, learning mission).
   Dedicated classes — do not use .text-gray-900 (dark remap fights a light card). */
[data-chat-feedback],
.chat-feedback-panel {
    margin-top: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(30, 74, 140, 0.22);
    background: #F8FAFC;
    color: #142033;
}

[data-chat-feedback] .chat-feedback-block,
.chat-feedback-panel .chat-feedback-block {
    display: block;
}

[data-chat-feedback] .chat-feedback-block + .chat-feedback-block,
.chat-feedback-panel .chat-feedback-block + .chat-feedback-block {
    margin-top: 0.5rem;
}

[data-chat-feedback] .chat-feedback-label,
.chat-feedback-panel .chat-feedback-label {
    display: block;
    margin: 0 0 0.2rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
    color: #1E4A8C;
}

[data-chat-feedback] .chat-feedback-body,
.chat-feedback-panel .chat-feedback-body {
    display: block;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.45;
    color: #142033;
}

[data-chat-feedback] .chat-feedback-body strong,
.chat-feedback-panel .chat-feedback-body strong {
    font-weight: 800;
    color: inherit;
}

html[data-theme="dark"] [data-chat-feedback],
html[data-theme="dark"] .chat-feedback-panel {
    background: #243044;
    border-color: rgba(147, 197, 253, 0.28);
    color: #F1F5F9;
}

html[data-theme="dark"] [data-chat-feedback] .chat-feedback-label,
html[data-theme="dark"] .chat-feedback-panel .chat-feedback-label {
    color: #93C5FD;
}

html[data-theme="dark"] [data-chat-feedback] .chat-feedback-body,
html[data-theme="dark"] .chat-feedback-panel .chat-feedback-body {
    color: #F1F5F9;
}

/* Toast notification styles */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.app-toast {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--teacher-border);
  background: var(--teacher-card);
  color: var(--teacher-text);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
  animation: fadeInUp 0.22s ease;
}

.app-toast i {
  margin-top: 0.12rem;
  font-size: 0.95rem;
  color: var(--teacher-text-secondary);
}

.app-toast.is-leaving {
  animation: fadeOutDown 0.28s ease forwards;
}

.app-toast--success {
  border-color: rgba(29, 158, 117, 0.22);
  background: color-mix(in srgb, var(--teacher-primary-soft) 72%, var(--teacher-card));
  color: var(--teacher-primary-dark);
}

.app-toast--success i {
  color: var(--teacher-primary);
}

.app-toast--error {
  border-color: rgba(185, 28, 28, 0.18);
  background: #fff1f2;
  color: #9f1239;
}

.app-toast--error i {
  color: #be123c;
}

.app-toast--info {
  border-color: var(--teacher-border-strong);
}

html[data-theme="dark"] .app-toast {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .app-toast--success {
  color: var(--teacher-primary);
}

html[data-theme="dark"] .app-toast--error {
  background: rgba(185, 28, 28, 0.18);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fecaca;
}

html[data-theme="dark"] .app-toast--error i {
  color: #fca5a5;
}

@media (max-width: 639px) {
  .app-toast {
    /* Tab bar is ~4.5rem (py-2 + h-14). Clear its shadow + tap targets. */
    bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-toast,
  .app-toast.is-leaving {
    animation: none;
  }
}

.swal2-container {
  z-index: 10000 !important;
}

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
}

/* Styles for difficult words practice mode — see #recordingPage.is-word-practice */

/* Audio segment highlight */
.playing-segment {
  background-color: rgba(79, 70, 229, 0.1);
  border-radius: 4px;
  padding: 2px;
  transition: background-color 0.3s;
}

/* Mission card + button utility classes (Tailwind v2 compatible).
   Avoids arbitrary classes like bg-[#...] or emerald-* that do NOT exist in v2. */
.mission-card-wrap {
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.06);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.04);
}
.mission-header-gradient {
    background: linear-gradient(135deg, #EEEDFE 0%, #ffffff 55%, #F7F8FC 100%);
    border: 1px solid rgba(83, 74, 183, 0.14);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.04);
}
/* Mission conclusion banner — mint family; readable in light + dark */
.mission-banner-success {
    background: linear-gradient(145deg, var(--teacher-primary-soft, #E1F5EE) 0%, var(--teacher-card, #FFFFFF) 72%);
    border: 1px solid rgba(29, 158, 117, 0.22);
    box-shadow: 0 6px 20px -12px rgba(15, 110, 86, 0.45);
    color: var(--teacher-text, #1A1A1A);
}
.mission-banner-failed {
    background: linear-gradient(145deg, #FFF1F2 0%, var(--teacher-card, #FFFFFF) 72%);
    border: 1px solid rgba(220, 38, 38, 0.18);
    box-shadow: 0 6px 20px -12px rgba(185, 28, 28, 0.45);
    color: var(--teacher-text, #1A1A1A);
}
.mission-banner-title {
    color: var(--teacher-primary-dark, #0F6E56);
}
.mission-banner-failed .mission-banner-title {
    color: #991B1B;
}
.mission-banner-subtitle {
    color: rgba(15, 110, 86, 0.88);
}
.mission-banner-failed .mission-banner-subtitle {
    color: rgba(153, 27, 27, 0.9);
}
.mission-icon-success {
    background: var(--teacher-primary, #1D9E75);
    color: #fff;
    box-shadow: 0 6px 14px -8px rgba(15, 110, 86, 0.7);
}
.mission-icon-failed {
    background: #DC2626;
    color: #fff;
    box-shadow: 0 6px 14px -8px rgba(185, 28, 28, 0.7);
}
.mission-status-pill-progress {
    background: var(--teacher-secondary-soft, #EEEDFE);
    color: var(--teacher-secondary, #534AB7);
    border: 1px solid rgba(83, 74, 183, 0.16);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.mission-status-pill-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.mission-status-pill-failed {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.mission-chip-phrases {
    background: var(--teacher-secondary-soft, #EEEDFE);
    color: var(--teacher-secondary, #534AB7);
    border: 1px solid rgba(83, 74, 183, 0.18);
    box-shadow: none;
}
.mission-chip-goals {
    background: var(--teacher-primary-soft, #E1F5EE);
    color: var(--teacher-primary-dark, #0F6E56);
    border: 1px solid rgba(29, 158, 117, 0.2);
    box-shadow: none;
}
.mission-chip-turns {
    background: var(--teacher-surface-muted, #F5F5F7);
    color: var(--teacher-text, #1F2937);
    border: 1px solid var(--teacher-border, rgba(17, 24, 39, 0.08));
    box-shadow: none;
}
.mission-feedback-wrap {
    background: var(--teacher-surface-muted, #F5F5F7);
    border: 1px solid var(--teacher-border, rgba(17, 24, 39, 0.08));
    color: var(--teacher-text, #1A1A1A);
}
.mission-feedback-wrap ul,
.mission-feedback-wrap li {
    color: var(--teacher-text, #1A1A1A);
}
.mission-feedback-label-positive {
    color: var(--teacher-primary-dark, #0F6E56);
}
.mission-feedback-label-improve {
    color: var(--teacher-secondary, #534AB7);
}
.mission-feedback-pill {
    background: var(--teacher-primary, #1D9E75);
    color: #FFFFFF;
}

html[data-theme="dark"] .mission-banner-success {
    background: linear-gradient(145deg, rgba(62, 207, 142, 0.18) 0%, var(--teacher-card, #1C1F28) 58%, #171a22 100%);
    border-color: rgba(62, 207, 142, 0.34);
    box-shadow: 0 10px 28px -18px rgba(0, 0, 0, 0.75);
    color: var(--teacher-text, #F3F4F6);
}
html[data-theme="dark"] .mission-banner-failed {
    background: linear-gradient(145deg, rgba(220, 38, 38, 0.16) 0%, var(--teacher-card, #1C1F28) 58%, #171a22 100%);
    border-color: rgba(248, 113, 113, 0.32);
    box-shadow: 0 10px 28px -18px rgba(0, 0, 0, 0.75);
    color: var(--teacher-text, #F3F4F6);
}
html[data-theme="dark"] .mission-banner-title {
    color: var(--teacher-primary-dark-theme, #3ECF8E);
}
html[data-theme="dark"] .mission-banner-failed .mission-banner-title {
    color: #FCA5A5;
}
html[data-theme="dark"] .mission-banner-subtitle {
    color: rgba(167, 243, 208, 0.88);
}
html[data-theme="dark"] .mission-banner-failed .mission-banner-subtitle {
    color: rgba(254, 202, 202, 0.9);
}
html[data-theme="dark"] .mission-chip-phrases {
    background: rgba(139, 131, 232, 0.16);
    color: var(--teacher-secondary-dark-theme, #8B83E8);
    border-color: rgba(139, 131, 232, 0.3);
}
html[data-theme="dark"] .mission-chip-goals {
    background: rgba(62, 207, 142, 0.14);
    color: var(--teacher-primary-dark-theme, #3ECF8E);
    border-color: rgba(62, 207, 142, 0.3);
}
html[data-theme="dark"] .mission-chip-turns {
    background: rgba(255, 255, 255, 0.06);
    color: var(--teacher-text, #F3F4F6);
    border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .mission-feedback-wrap {
    /* Avoid white glass + inverted gray text (was unreadable on dark). */
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #F9FAFB;
}
html[data-theme="dark"] .mission-feedback-wrap ul,
html[data-theme="dark"] .mission-feedback-wrap li {
    color: #F9FAFB;
}
html[data-theme="dark"] .mission-feedback-label-positive {
    color: var(--teacher-primary-dark-theme, #3ECF8E);
}
html[data-theme="dark"] .mission-feedback-label-improve {
    color: var(--teacher-secondary-dark-theme, #8B83E8);
}
html[data-theme="dark"] .mission-status-pill-success {
    background: rgba(62, 207, 142, 0.16);
    color: #A7F3D0;
    border-color: rgba(62, 207, 142, 0.28);
}
html[data-theme="dark"] .mission-status-pill-failed {
    background: rgba(220, 38, 38, 0.16);
    color: #FECACA;
    border-color: rgba(248, 113, 113, 0.28);
}
.mission-objective-dot-done {
    background: #1D9E75;
    color: #fff;
    box-shadow: 0 6px 14px -10px rgba(15, 110, 86, 0.8);
}
.mission-objective-dot-progress {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
}
.mission-objective-dot-todo {
    background: #fff;
    color: #9CA3AF;
    border: 1px solid rgba(17, 24, 39, 0.08);
}
.mission-objective-card-done {
    background: linear-gradient(90deg, #E1F5EE 0%, #F7F8FC 60%, #ffffff 100%);
    border: 1px solid rgba(29, 158, 117, 0.16);
}
.mission-objective-card-progress {
    background: linear-gradient(90deg, #FFFBEB 0%, #F7F8FC 60%, #ffffff 100%);
    border: 1px solid #FDE68A;
}
.mission-objective-card-todo {
    background: rgba(247, 248, 252, 0.6);
    border: 1px solid rgba(17, 24, 39, 0.06);
}
.mission-phrase-dot-filled {
    background: #534AB7;
    border: 1px solid rgba(83, 74, 183, 0.45);
    box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.10);
}
.mission-phrase-dot-empty {
    background: #E5E7EB;
    border: 1px solid rgba(17, 24, 39, 0.06);
}
.mission-btn-primary {
    background: var(--teacher-primary) !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 10px 22px -14px rgba(15, 110, 86, 0.85);
    transition: background-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.mission-btn-primary:hover {
    background: var(--teacher-primary-dark) !important;
    box-shadow: 0 12px 24px -14px rgba(15, 110, 86, 0.95);
}
.mission-btn-primary:active {
    background: var(--teacher-primary-dark) !important;
    transform: translateY(0px);
}
.mission-btn-primary:focus {
    outline: none;
}
.mission-btn-primary:focus-visible {
    box-shadow: 0 0 0 2px var(--teacher-card), 0 0 0 4px var(--teacher-primary);
}
.mission-btn-primary span,
.mission-btn-primary i {
    color: #FFFFFF !important;
}
.mission-btn-secondary {
    background: var(--teacher-card) !important;
    color: var(--teacher-text) !important;
    border: 1px solid var(--teacher-border) !important;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.04);
    transition: background-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.mission-btn-secondary:hover {
    background: var(--teacher-surface-hover) !important;
}
.mission-btn-secondary span {
    color: var(--teacher-text) !important;
}
.mission-btn-secondary i {
    color: var(--teacher-text-secondary) !important;
}

/* Unit card focus highlight when returning from a chat mission / learning module. */
.unit-card.is-returning-focus {
    box-shadow: 0 0 0 4px rgba(29, 158, 117, 0.20), 0 22px 48px -20px rgba(83, 74, 183, 0.55) !important;
    transform: translateY(-1px) scale(1.006);
    transition: transform 200ms ease, box-shadow 200ms ease;
    z-index: 5;
    position: relative;
}

/* Module mission: conversation-first Operate chrome */
#chatPage.is-learning-mission #chatPageHeader {
    margin-bottom: 0;
}

#chatPage.is-learning-mission [data-chat-menu="free-only"] {
    display: none !important;
}

/* Keep conversation + composer as the primary flex region. */
#chatPage.is-learning-mission .chat-desktop-shell {
    gap: 0;
}

#chatPage.is-learning-mission .chat-messages-pane {
    flex: 1 1 auto;
    min-height: 10rem;
}

#chatPage.is-learning-mission #chatComposerRow {
    flex-shrink: 0;
    margin-top: 0.5rem;
    position: sticky;
    bottom: 0;
    z-index: 12;
    background: linear-gradient(180deg, transparent 0%, var(--teacher-card, #fff) 28%);
    padding-top: 0.35rem;
}

#chatPage.is-learning-mission #chatComposerRow .focus-within\:ring-blue-500:focus-within,
#chatPage.is-learning-mission #chatComposerRow [class*="focus-within:ring-blue-500"]:focus-within {
    --tw-ring-color: var(--teacher-primary);
}

#chatPage.is-learning-mission #chatInput:focus,
#chatPage.is-learning-mission #chatComposerRow textarea:focus {
    outline: none;
}

#chatPage.is-learning-mission #chatComposerRow .chat-composer-field {
    border-color: var(--teacher-border);
    background: var(--teacher-card);
}

#chatPage.is-learning-mission #chatComposerRow .chat-composer-field:focus-within {
    box-shadow: 0 0 0 2px var(--teacher-primary-soft);
    border-color: var(--teacher-primary);
}

#chatPage.is-learning-mission #chatRecordBtn {
    background: var(--teacher-primary);
}

#chatPage.is-learning-mission #chatRecordBtn:hover {
    background: var(--teacher-primary-dark);
}

#chatPage.is-learning-mission #chatRecordBtn:focus {
    --tw-ring-color: var(--teacher-primary);
}

/* Slim end-state / start dock — never a tall header */
.chat-mission-dock {
    flex: 0 0 auto;
    color: var(--teacher-text);
}

.chat-mission-cta-dock {
    flex-shrink: 0;
}

.chat-thread-surface {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--teacher-surface-muted);
    border-color: var(--teacher-border);
}

.chat-thread-surface > .chat-messages-scroll-wrap {
    flex: 1 1 auto;
    min-height: 0;
}

.chat-thread-surface #chatMessages {
    background: transparent;
    border: 0;
}

/*
 * Mission chrome must NEVER paint in free chat / roleplay.
 * styles.css loads after Tailwind, so `display:flex` used to beat `.hidden`.
 */
#chatPage:not(.is-learning-mission) #chatMissionThreadBrief,
#chatPage:not(.is-learning-mission) #chatMissionCard,
#chatMissionThreadBrief.hidden,
#chatMissionCard.hidden {
    display: none !important;
}

/*
 * Roleplay chrome must NEVER paint in free chat / learning mission.
 */
#chatPage:not(.is-roleplay) #chatRoleplayBriefing,
#chatPage:not(.is-roleplay) #chatRoleplayCard,
#chatRoleplayBriefing.hidden,
#chatRoleplayCard.hidden {
    display: none !important;
}

/* ── Roleplay: conversation-first compact briefing ── */
#chatPage.is-roleplay .chat-desktop-shell {
    gap: 0;
}

#chatPage.is-roleplay .chat-messages-pane {
    flex: 1 1 auto;
    min-height: 10rem;
}

#chatPage.is-roleplay #chatComposerRow {
    flex-shrink: 0;
    margin-top: 0.5rem;
    position: sticky;
    bottom: 0;
    z-index: 12;
    background: linear-gradient(180deg, transparent 0%, var(--teacher-card, #fff) 28%);
    padding-top: 0.35rem;
}

#chatPage.is-roleplay #chatComposerRow .chat-composer-field {
    border-color: var(--teacher-border);
    background: var(--teacher-card);
}

#chatPage.is-roleplay #chatComposerRow .chat-composer-field:focus-within {
    box-shadow: 0 0 0 2px var(--teacher-primary-soft);
    border-color: var(--teacher-primary);
}

#chatPage.is-roleplay #chatRecordBtn {
    background: var(--teacher-primary);
}

#chatPage.is-roleplay #chatRecordBtn:hover {
    background: var(--teacher-primary-dark);
}

/* Scene atmosphere lives only inside the compact bar — not shell/thread. */
#chatPage.is-roleplay #chatRoleplayBriefing:not(.hidden) {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
    border: 1px solid var(--teacher-border);
    border-radius: 0.875rem;
    background: var(--teacher-card);
    color: var(--teacher-text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

#chatPage.is-roleplay .roleplay-briefing-bar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.7rem 0.75rem;
    min-height: 5.25rem;
    overflow: hidden;
}

#chatPage.is-roleplay .roleplay-briefing-scene {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

#chatPage.is-roleplay .roleplay-briefing-scene-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    transform: scale(1.04);
}

/* Dual scrim: left readability for title + bottom into details. */
#chatPage.is-roleplay .roleplay-briefing-scene-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.78) 0%, rgba(15, 23, 42, 0.42) 48%, rgba(15, 23, 42, 0.22) 100%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.18) 0%, rgba(15, 23, 42, 0.55) 100%);
}

#chatPage.is-roleplay .roleplay-briefing-heading {
    position: relative;
    z-index: 1;
    min-width: 0;
}

#chatPage.is-roleplay .roleplay-briefing-title {
    font-size: 0.875rem;
    font-weight: 800;
    line-height: 1.25;
    color: #F8FAFC;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 8px rgba(15, 23, 42, 0.45);
}

#chatPage.is-roleplay .roleplay-briefing-status {
    margin-top: 0.3rem;
}

#chatPage.is-roleplay .roleplay-briefing-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 1.375rem;
    padding: 0 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    color: #E2E8F0;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
}

#chatPage.is-roleplay .roleplay-briefing-status-check {
    display: none;
    font-size: 0.5625rem;
    line-height: 1;
}

#chatPage.is-roleplay #chatRoleplayBriefing.is-done,
#chatPage.is-roleplay #chatRoleplayBriefing[data-roleplay-status="success"] {
    border-color: color-mix(in srgb, var(--teacher-primary) 42%, var(--teacher-border));
    box-shadow: 0 1px 2px rgba(15, 110, 86, 0.12);
}

#chatPage.is-roleplay #chatRoleplayBriefing.is-done .roleplay-briefing-scene-scrim,
#chatPage.is-roleplay #chatRoleplayBriefing[data-roleplay-status="success"] .roleplay-briefing-scene-scrim {
    background:
        linear-gradient(90deg, rgba(8, 32, 26, 0.84) 0%, rgba(15, 23, 42, 0.42) 52%, rgba(15, 23, 42, 0.2) 100%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.14) 0%, rgba(15, 110, 86, 0.42) 100%);
}

#chatPage.is-roleplay #chatRoleplayBriefing.is-done .roleplay-briefing-status-chip,
#chatPage.is-roleplay #chatRoleplayBriefing[data-roleplay-status="success"] .roleplay-briefing-status-chip,
#chatPage.is-roleplay .roleplay-briefing-status.is-done .roleplay-briefing-status-chip {
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
}

#chatPage.is-roleplay #chatRoleplayBriefing.is-done .roleplay-briefing-status-check,
#chatPage.is-roleplay #chatRoleplayBriefing[data-roleplay-status="success"] .roleplay-briefing-status-check,
#chatPage.is-roleplay .roleplay-briefing-status.is-done .roleplay-briefing-status-check {
    display: inline-block;
}

#chatPage.is-roleplay .roleplay-briefing-actions {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

#chatPage.is-roleplay .roleplay-briefing-icon-btn {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(15, 23, 42, 0.38);
    color: #F8FAFC;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

#chatPage.is-roleplay .roleplay-briefing-icon-btn:hover {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(255, 255, 255, 0.4);
}

#chatPage.is-roleplay .roleplay-briefing-icon-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(62, 207, 142, 0.55);
}

#chatPage.is-roleplay .roleplay-briefing-icon-btn.is-active {
    border-color: rgba(167, 243, 208, 0.55);
    background: rgba(29, 158, 117, 0.42);
    color: #ECFDF5;
}

/* Details sit on solid card — readable in light/dark; scene stays in the strip. */
#chatPage.is-roleplay .roleplay-briefing-details {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--teacher-border);
    background: var(--teacher-card);
}

#chatPage.is-roleplay #chatRoleplayBriefing[data-roleplay-expanded="false"] .roleplay-briefing-details {
    display: none;
}

#chatPage.is-roleplay .roleplay-briefing-details-inner {
    padding: 0.5rem 0.75rem 0.625rem;
}

#chatPage.is-roleplay .roleplay-briefing-objective {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--teacher-text);
}

#chatPage.is-roleplay .roleplay-briefing-objective-mark {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.1rem;
    border-radius: 9999px;
    border: 1.5px solid var(--teacher-border-strong);
    background: transparent;
    color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#chatPage.is-roleplay .roleplay-briefing-objective-mark i {
    font-size: 0.5rem;
    line-height: 1;
}

#chatPage.is-roleplay .roleplay-briefing-objective.is-done .roleplay-briefing-objective-mark,
#chatPage.is-roleplay #chatRoleplayBriefing.is-done .roleplay-briefing-objective-mark,
#chatPage.is-roleplay #chatRoleplayBriefing[data-roleplay-status="success"] .roleplay-briefing-objective-mark {
    border-color: var(--teacher-primary);
    background: var(--teacher-primary);
    color: #fff;
}

#chatPage.is-roleplay .roleplay-briefing-context.is-done {
    color: var(--teacher-text);
}

#chatPage.is-roleplay .roleplay-briefing-objective-text {
    min-width: 0;
    flex: 1 1 auto;
}

#chatPage.is-roleplay .roleplay-briefing-context {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--teacher-text-secondary);
}

#chatPage.is-roleplay .roleplay-briefing-trans {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--teacher-text-secondary);
}

/* Slim completion dock (success only) */
#chatPage.is-roleplay #chatRoleplayCard:not(.hidden) {
    flex: 0 0 auto;
    display: block;
    border: 1px solid rgba(29, 158, 117, 0.28);
    border-radius: 0.875rem;
    background: var(--teacher-primary-soft);
    color: var(--teacher-text);
    box-shadow: none;
}

.roleplay-complete-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
}

.roleplay-complete-title {
    font-size: 0.8125rem;
    font-weight: 800;
    color: var(--teacher-text);
}

.roleplay-complete-hint {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--teacher-text-secondary);
}

.roleplay-complete-pill {
    height: 1.75rem;
    padding: 0 0.75rem;
    border-radius: 9999px;
    background: rgba(29, 158, 117, 0.18);
    color: var(--teacher-primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

.roleplay-complete-cta {
    flex-shrink: 0;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: 9999px;
    background: var(--teacher-primary);
    color: #fff;
    font-weight: 800;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 140ms ease;
}

.roleplay-complete-cta:hover {
    background: var(--teacher-primary-dark);
}

html[data-theme="dark"] #chatPage.is-roleplay #chatRoleplayBriefing:not(.hidden) {
    background: var(--teacher-card);
    border-color: var(--teacher-border);
}

/* Bar copy stays light on the photo scrim in both themes; details use tokens. */
html[data-theme="dark"] #chatPage.is-roleplay .roleplay-briefing-scene-scrim {
    background:
        linear-gradient(90deg, rgba(8, 10, 16, 0.82) 0%, rgba(8, 10, 16, 0.5) 48%, rgba(8, 10, 16, 0.28) 100%),
        linear-gradient(180deg, rgba(8, 10, 16, 0.22) 0%, rgba(8, 10, 16, 0.62) 100%);
}

html[data-theme="dark"] #chatPage.is-roleplay .roleplay-briefing-details {
    background: var(--teacher-card);
    border-top-color: var(--teacher-border);
}

html[data-theme="dark"] #chatPage.is-roleplay .roleplay-briefing-objective {
    color: var(--teacher-text);
}

html[data-theme="dark"] #chatPage.is-roleplay #chatRoleplayBriefing.is-done,
html[data-theme="dark"] #chatPage.is-roleplay #chatRoleplayBriefing[data-roleplay-status="success"] {
    border-color: color-mix(in srgb, var(--teacher-primary) 48%, var(--teacher-border));
}

html[data-theme="dark"] #chatPage.is-roleplay #chatRoleplayBriefing.is-done .roleplay-briefing-status-chip,
html[data-theme="dark"] #chatPage.is-roleplay #chatRoleplayBriefing[data-roleplay-status="success"] .roleplay-briefing-status-chip,
html[data-theme="dark"] #chatPage.is-roleplay .roleplay-briefing-status.is-done .roleplay-briefing-status-chip {
    background: rgba(62, 207, 142, 0.22);
    color: var(--teacher-primary);
}

html[data-theme="dark"] #chatPage.is-roleplay #chatRoleplayBriefing.is-done .roleplay-briefing-scene-scrim,
html[data-theme="dark"] #chatPage.is-roleplay #chatRoleplayBriefing[data-roleplay-status="success"] .roleplay-briefing-scene-scrim {
    background:
        linear-gradient(90deg, rgba(6, 22, 18, 0.88) 0%, rgba(8, 10, 16, 0.5) 52%, rgba(8, 10, 16, 0.26) 100%),
        linear-gradient(180deg, rgba(8, 10, 16, 0.18) 0%, rgba(15, 110, 86, 0.48) 100%);
}

html[data-theme="dark"] #chatPage.is-roleplay .roleplay-briefing-context.is-done {
    color: #C4CBD6;
}

html[data-theme="dark"] #chatPage.is-roleplay .roleplay-briefing-context,
html[data-theme="dark"] #chatPage.is-roleplay .roleplay-briefing-trans,
html[data-theme="dark"] .roleplay-complete-hint {
    color: #C4CBD6;
}

html[data-theme="dark"] #chatPage.is-roleplay #chatRoleplayCard:not(.hidden) {
    background: rgba(62, 207, 142, 0.12);
    border-color: rgba(62, 207, 142, 0.32);
}

html[data-theme="dark"] .roleplay-complete-pill {
    background: rgba(62, 207, 142, 0.2);
    color: var(--teacher-primary-dark-theme, #3ECF8E);
}

html[data-theme="dark"] #chatPage.is-roleplay #chatComposerRow {
    background: linear-gradient(180deg, transparent 0%, var(--teacher-card) 28%);
}

@media (max-width: 639px) {
    #chatPage.is-roleplay .chat-messages-pane {
        min-height: 10rem;
    }

    #chatPage.is-roleplay .roleplay-briefing-bar {
        min-height: 4.75rem;
        padding: 0.6rem 0.625rem;
        gap: 0.5rem;
    }

    #chatPage.is-roleplay .roleplay-briefing-title {
        font-size: 0.8125rem;
    }

    .roleplay-complete-inner {
        flex-wrap: wrap;
    }
}

/* ── Roleplay pick modal (SweetAlert2) — scoped; does not restyle other Swals ── */
.swal2-popup.roleplay-pick-popup {
    background: var(--teacher-card) !important;
    color: var(--teacher-text) !important;
    border: 1px solid var(--teacher-border);
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-swal-title,
.swal2-popup.roleplay-pick-popup .swal2-title {
    color: var(--teacher-text) !important;
    font-weight: 800;
    font-size: 1.125rem;
}

.swal2-popup.roleplay-pick-popup .swal2-html-container,
.swal2-popup.roleplay-pick-popup .roleplay-pick-swal-html {
    color: var(--teacher-text) !important;
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-lead {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--teacher-text-secondary);
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-item {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid var(--teacher-border-strong);
    background: var(--teacher-card);
    color: var(--teacher-text);
    padding: 0.75rem 1rem;
    text-align: left;
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-item.is-unlocked:hover {
    background: var(--teacher-surface-hover);
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-item.is-locked {
    background: var(--teacher-surface-muted);
    opacity: 0.72;
    cursor: not-allowed;
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-item.is-selected {
    border-color: rgba(29, 158, 117, 0.55);
    box-shadow: 0 0 0 2px var(--teacher-primary-soft);
    background: var(--teacher-primary-soft);
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-item-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-item-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-thumb {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--teacher-border);
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-title {
    font-size: 0.875rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--teacher-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-desc {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--teacher-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.35rem 0.55rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-badge--score {
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
    border-color: rgba(29, 158, 117, 0.28);
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-badge--done {
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
    border-color: rgba(29, 158, 117, 0.35);
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-badge--locked {
    background: var(--teacher-surface-muted);
    color: var(--teacher-text-secondary);
    border-color: var(--teacher-border);
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-confirm {
    width: 100%;
    height: 3rem;
    padding: 0 1.25rem;
    border-radius: 1rem;
    background: var(--teacher-primary);
    color: #fff;
    font-weight: 800;
    transition: background 140ms ease;
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-confirm:hover {
    background: var(--teacher-primary-dark);
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-cancel {
    width: 100%;
    height: 3rem;
    padding: 0 1.25rem;
    border-radius: 1rem;
    background: var(--teacher-card);
    border: 1px solid var(--teacher-border-strong);
    color: var(--teacher-text);
    font-weight: 800;
    transition: background 140ms ease;
}

.swal2-popup.roleplay-pick-popup .roleplay-pick-cancel:hover {
    background: var(--teacher-surface-hover);
}

@media (min-width: 640px) {
    .swal2-popup.roleplay-pick-popup .roleplay-pick-confirm,
    .swal2-popup.roleplay-pick-popup .roleplay-pick-cancel {
        width: auto;
    }
}

html[data-theme="dark"] .swal2-popup.roleplay-pick-popup {
    background: var(--teacher-card) !important;
    color: var(--teacher-text) !important;
    border-color: var(--teacher-border);
}

html[data-theme="dark"] .swal2-popup.roleplay-pick-popup .roleplay-pick-lead {
    color: #C4CBD6;
}

html[data-theme="dark"] .swal2-popup.roleplay-pick-popup .roleplay-pick-desc {
    color: #C4CBD6;
}

html[data-theme="dark"] .swal2-popup.roleplay-pick-popup .roleplay-pick-title {
    color: var(--teacher-text);
}

html[data-theme="dark"] .swal2-popup.roleplay-pick-popup .roleplay-pick-item {
    background: var(--teacher-surface-muted);
    border-color: var(--teacher-border);
}

html[data-theme="dark"] .swal2-popup.roleplay-pick-popup .roleplay-pick-item.is-unlocked:hover {
    background: var(--teacher-surface-hover);
}

html[data-theme="dark"] .swal2-popup.roleplay-pick-popup .roleplay-pick-item.is-selected {
    background: var(--teacher-primary-soft);
    border-color: rgba(62, 207, 142, 0.55);
    box-shadow: 0 0 0 2px rgba(62, 207, 142, 0.22);
}

html[data-theme="dark"] .swal2-popup.roleplay-pick-popup .roleplay-pick-badge--score,
html[data-theme="dark"] .swal2-popup.roleplay-pick-popup .roleplay-pick-badge--done {
    background: rgba(62, 207, 142, 0.18);
    color: var(--teacher-primary-dark-theme, #3ECF8E);
    border-color: rgba(62, 207, 142, 0.35);
}

html[data-theme="dark"] .swal2-popup.roleplay-pick-popup .roleplay-pick-badge--locked {
    background: var(--teacher-surface-hover);
    color: #C4CBD6;
    border-color: var(--teacher-border);
}

html[data-theme="dark"] .swal2-popup.roleplay-pick-popup .roleplay-pick-cancel {
    background: var(--teacher-surface-muted);
    border-color: var(--teacher-border);
    color: var(--teacher-text);
}

/* ── Chat history picker (in-app sheet + scoped Swal fallback) ── */
#chatHistoryModal .chat-history-sheet,
.swal2-popup.history-pick-popup {
    background: var(--teacher-card);
    color: var(--teacher-text);
    border: 1px solid var(--teacher-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.swal2-popup.history-pick-popup {
    width: min(28rem, calc(100vw - 1.5rem)) !important;
    padding: 1.25rem 1.25rem 1rem !important;
}

.chat-history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 0.5rem;
}

.chat-history-title,
.swal2-popup.history-pick-popup .history-pick-swal-title,
.swal2-popup.history-pick-popup .swal2-title {
    margin: 0;
    color: var(--teacher-text) !important;
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.2;
}

.chat-history-lead,
.swal2-popup.history-pick-popup .history-pick-lead {
    margin: 0.375rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--teacher-text-secondary);
}

.chat-history-close {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: var(--teacher-text-secondary);
    transition: background-color 140ms ease, color 140ms ease;
}

.chat-history-close:hover {
    background: var(--teacher-surface-hover);
    color: var(--teacher-text);
}

.chat-history-close:focus-visible,
.history-pick-item:focus-visible,
.history-pick-confirm:focus-visible,
.history-pick-cancel:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

.chat-history-body,
.swal2-popup.history-pick-popup .swal2-html-container,
.swal2-popup.history-pick-popup .history-pick-swal-html {
    color: var(--teacher-text) !important;
    padding: 0.25rem 1.25rem 0;
    margin: 0 !important;
}

.swal2-popup.history-pick-popup .swal2-html-container {
    padding: 0.25rem 0 0;
}

.history-pick-list {
    display: grid;
    gap: 0.375rem;
    max-height: min(52vh, 22rem);
    overflow-y: auto;
    padding: 0.125rem;
    scrollbar-color: var(--teacher-border-strong) transparent;
    scrollbar-width: thin;
}

.history-pick-item {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 3.25rem;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--teacher-border-strong);
    background: var(--teacher-card);
    color: var(--teacher-text);
    text-align: left;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.history-pick-item:hover {
    background: var(--teacher-surface-hover);
}

.history-pick-item.is-selected {
    border-color: rgba(29, 158, 117, 0.55);
    box-shadow: 0 0 0 2px var(--teacher-primary-soft);
    background: var(--teacher-primary-soft);
}

.history-pick-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.2rem;
}

.history-pick-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--teacher-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-pick-meta {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--teacher-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.history-pick-empty {
    padding: 0.75rem 0.15rem 0.35rem;
}

.history-pick-empty-title {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--teacher-text);
}

.history-pick-empty-body {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--teacher-text-secondary);
}

.history-pick-loading {
    display: grid;
    gap: 0.375rem;
}

.history-pick-skel {
    height: 3.25rem;
    border-radius: 1rem;
    background: var(--teacher-surface-muted);
    position: relative;
    overflow: hidden;
}

.history-pick-skel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    animation: history-pick-shimmer 1.2s ease-in-out infinite;
}

@keyframes history-pick-shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.chat-history-status {
    min-height: 1.1rem;
    margin: 0.35rem 1.25rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--teacher-text-secondary);
}

.chat-history-actions,
.swal2-popup.history-pick-popup .history-pick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem 1.15rem;
}

.swal2-popup.history-pick-popup .history-pick-actions {
    padding: 0.85rem 0 0;
}

.history-pick-confirm,
.history-pick-cancel {
    flex: 1 1 8rem;
    min-height: 2.75rem;
    height: 2.75rem;
    padding: 0 1.125rem;
    border-radius: 9999px;
    font-weight: 800;
    transition: background 140ms ease, border-color 140ms ease;
}

.history-pick-confirm {
    background: var(--teacher-primary);
    color: #fff;
    border: 0;
    box-shadow: 0 1px 2px rgba(15, 110, 86, 0.28);
}

.history-pick-confirm:hover {
    background: var(--teacher-primary-dark);
}

.history-pick-confirm:disabled,
.history-pick-confirm[hidden] {
    opacity: 0.55;
}

.history-pick-cancel {
    background: var(--teacher-card);
    border: 1px solid var(--teacher-border-strong);
    color: var(--teacher-text);
}

.history-pick-cancel:hover {
    background: var(--teacher-surface-hover);
}

.swal2-popup.history-pick-popup .swal2-validation-message {
    background: var(--teacher-surface-muted);
    color: var(--teacher-text);
    border: 0;
    margin: 0.5rem 0 0;
}

html[data-theme="dark"] #chatHistoryModal .chat-history-sheet,
html[data-theme="dark"] .swal2-popup.history-pick-popup {
    background: var(--teacher-card);
    color: var(--teacher-text);
    border-color: var(--teacher-border);
}

html[data-theme="dark"] .chat-history-lead,
html[data-theme="dark"] .history-pick-lead,
html[data-theme="dark"] .history-pick-meta,
html[data-theme="dark"] .history-pick-empty-body {
    color: #C4CBD6;
}

html[data-theme="dark"] .history-pick-item {
    background: var(--teacher-surface-muted);
    border-color: var(--teacher-border);
}

html[data-theme="dark"] .history-pick-item:hover {
    background: var(--teacher-surface-hover);
}

html[data-theme="dark"] .history-pick-item.is-selected {
    background: var(--teacher-primary-soft);
    border-color: rgba(62, 207, 142, 0.55);
    box-shadow: 0 0 0 2px rgba(62, 207, 142, 0.22);
}

html[data-theme="dark"] .history-pick-title,
html[data-theme="dark"] .history-pick-empty-title,
html[data-theme="dark"] .chat-history-title {
    color: var(--teacher-text);
}

html[data-theme="dark"] .history-pick-cancel {
    background: var(--teacher-surface-muted);
    border-color: var(--teacher-border);
    color: var(--teacher-text);
}

html[data-theme="dark"] .history-pick-skel::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}

@media (prefers-reduced-motion: reduce) {
    .history-pick-item,
    .history-pick-confirm,
    .history-pick-cancel,
    .chat-history-close {
        transition: none;
    }
    .history-pick-skel::after {
        animation: none;
    }
}

/* Goals strip — only when learning mission and not .hidden */
#chatPage.is-learning-mission #chatMissionThreadBrief:not(.hidden) {
    flex: 0 0 auto;
    flex-shrink: 0;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--teacher-border);
    border-radius: 0;
    background: var(--teacher-card);
    color: var(--teacher-text);
    box-shadow: none;
    /* Fit all goals (typically 3) — no inner clip/scroll; thread scrolls separately. */
    overflow: visible;
    max-height: none;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

#chatPage.is-learning-mission #chatMissionThreadBrief:not(.hidden)[data-mission-expanded="false"] {
    max-height: none;
}

/* Details grow with content — do not scroll inside the goals strip. */
#chatPage.is-learning-mission #chatMissionDetails.chat-mission-details,
#chatPage.is-learning-mission .chat-mission-details {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    overscroll-behavior: auto;
}

/* Dense goal checklist (Operate) — scoped to learning mission only */
#chatPage.is-learning-mission .chat-mission-details-inner {
    padding: 0.25rem 0.625rem 0.375rem;
}

#chatPage.is-learning-mission .chat-mission-objectives-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
}

#chatPage.is-learning-mission .chat-mission-objective-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3125rem 0.5rem;
    border-radius: 0.5rem;
    min-height: 0;
}

#chatPage.is-learning-mission .chat-mission-objective-dot-wrap {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

#chatPage.is-learning-mission .chat-mission-objective-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    box-shadow: none;
}

#chatPage.is-learning-mission .chat-mission-objective-dot i {
    font-size: 0.5625rem;
    line-height: 1;
}

#chatPage.is-learning-mission .chat-mission-objective-dot .fa-circle {
    font-size: 0.3125rem;
}

#chatPage.is-learning-mission .chat-mission-objective-copy {
    min-width: 0;
    flex: 1 1 auto;
    font-weight: 600;
    line-height: 1rem;
}

#chatPage.is-learning-mission .chat-mission-objective-title {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1rem; /* match .chat-mission-objective-dot box */
    word-break: break-word;
}

#chatPage.is-learning-mission .chat-mission-objective-trans {
    margin-top: 0.125rem;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--teacher-text-secondary);
}

#chatPage.is-learning-mission .mission-objective-text-done {
    color: var(--teacher-primary-dark, #0F6E56);
}

#chatPage.is-learning-mission .mission-objective-text-progress {
    color: #92400E;
}

#chatPage.is-learning-mission .mission-objective-text-todo {
    color: var(--teacher-text);
}

#chatPage.is-learning-mission .mission-objective-card-todo,
#chatPage.is-learning-mission .mission-objective-card-progress,
#chatPage.is-learning-mission .mission-objective-card-done {
    box-shadow: none;
    background: transparent;
    border: 0;
    border-radius: 0.375rem;
}

#chatPage.is-learning-mission .mission-objective-card-progress {
    background: rgba(239, 159, 39, 0.08);
}

#chatPage.is-learning-mission .mission-objective-card-done {
    background: rgba(29, 158, 117, 0.08);
}

html[data-theme="dark"] #chatPage.is-learning-mission .mission-objective-text-todo {
    color: var(--teacher-text);
}

html[data-theme="dark"] #chatPage.is-learning-mission .mission-objective-text-done {
    color: var(--teacher-primary-dark-theme, #3ECF8E);
}

html[data-theme="dark"] #chatPage.is-learning-mission .mission-objective-card-todo {
    background: transparent;
}

html[data-theme="dark"] #chatPage.is-learning-mission .mission-objective-card-progress {
    background: rgba(239, 159, 39, 0.1);
}

html[data-theme="dark"] #chatPage.is-learning-mission .mission-objective-card-done {
    background: rgba(62, 207, 142, 0.08);
}

.chat-mission-goals-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    /* Tighter top so GOALS strip sits closer to thread-surface edge */
    padding: 0.25rem 0.75rem 0.375rem;
    flex-shrink: 0;
    background: var(--teacher-card);
    border-bottom: 1px solid var(--teacher-border);
}

.chat-mission-goals-bar .chat-mission-objectives-label {
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.chat-mission-goals-bar .chat-mission-objectives-label.is-complete {
    color: var(--teacher-primary-dark, #0F6E56);
}

.chat-mission-phrase-dots {
    max-width: 11rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.chat-mission-phrase-meter-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    color: var(--teacher-secondary, #534AB7);
    white-space: nowrap;
}

.chat-mission-phrase-dots.is-complete .chat-mission-phrase-meter-label {
    color: var(--teacher-primary-dark, #0F6E56);
}

@keyframes mission-banner-celebrate-in {
    from {
        opacity: 0.55;
        transform: translateY(0.35rem) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mission-banner-celebrate {
    animation: mission-banner-celebrate-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .mission-banner-celebrate {
        animation: none;
    }
}

/* Pre-start Valentina intro bubble — mint family */
.chat-mission-intro-bubble {
    background: var(--teacher-primary-soft) !important;
    border: 1px solid rgba(29, 158, 117, 0.28) !important;
    color: var(--teacher-text) !important;
    max-width: 22rem;
}

.chat-mission-intro-bubble .chat-mission-intro-title {
    font-size: 0.875rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
    color: var(--teacher-text);
}

.chat-mission-intro-bubble .chat-mission-intro-progress {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    color: var(--teacher-primary-dark);
}

.chat-mission-intro-bubble .chat-mission-intro-body {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--teacher-text);
}

.chat-mission-intro-bubble .chat-mission-intro-cta {
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--teacher-primary-dark);
}

.chat-mission-intro-bubble .chat-mission-intro-translation {
    color: var(--teacher-text-secondary);
    white-space: pre-wrap;
}

html[data-theme="dark"] .chat-mission-intro-bubble {
    background: rgba(62, 207, 142, 0.18) !important;
    border-color: rgba(62, 207, 142, 0.35) !important;
}

html[data-theme="dark"] .chat-mission-intro-bubble .chat-mission-intro-progress,
html[data-theme="dark"] .chat-mission-intro-bubble .chat-mission-intro-cta {
    color: var(--teacher-primary-dark-theme, #3ECF8E);
}

html[data-theme="dark"] .chat-mission-intro-bubble .chat-mission-intro-translation {
    color: var(--teacher-text-secondary-dark, #9CA3AF);
}

/* Translate control on mint intro — keep contrast with soft green surface */
#chatPage.is-learning-mission .chat-mission-intro-bubble button[data-chat-action="translate"] {
    border-color: rgba(29, 158, 117, 0.28);
    background: rgba(255, 255, 255, 0.82);
    color: var(--teacher-text-secondary);
}

html[data-theme="dark"] #chatPage.is-learning-mission .chat-mission-intro-bubble button[data-chat-action="translate"] {
    border-color: rgba(62, 207, 142, 0.28);
    background: rgba(28, 31, 40, 0.72);
    color: var(--teacher-text-secondary-dark, #9CA3AF);
}

.chat-mission-title {
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--teacher-text);
    word-break: break-word;
}

@media (min-width: 640px) {
    .chat-mission-title {
        font-size: 0.875rem;
    }
}

.chat-mission-progress,
.chat-mission-subtitle,
.chat-mission-turns,
.chat-mission-objectives-label {
    color: var(--teacher-text-secondary);
}

.chat-mission-progress {
    margin-top: 0.2rem;
    font-size: 0.71875rem;
    font-weight: 500;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.chat-mission-subtitle {
    margin-top: 0.2rem;
    font-size: 0.71875rem;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}

.chat-mission-turns {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.chat-mission-objectives-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.chat-mission-status-pill {
    height: 1.5rem;
    padding: 0 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--teacher-surface-muted);
    color: var(--teacher-text);
}

.chat-mission-translate-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background: var(--teacher-card);
    border: 1px solid var(--teacher-border);
    color: var(--teacher-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 120ms ease, color 120ms ease;
}

.chat-mission-translate-btn:hover {
    background: var(--teacher-surface-hover);
    color: var(--teacher-text);
}

.chat-mission-translate-btn:focus {
    outline: none;
}

.chat-mission-translate-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--teacher-card), 0 0 0 4px var(--teacher-primary);
}

.chat-mission-thread-brief .line-clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.chat-mission-toggle {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 1px solid var(--teacher-border);
    background: var(--teacher-card);
    color: var(--teacher-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 120ms ease, transform 160ms ease, color 120ms ease;
}

.chat-mission-toggle:hover {
    background: var(--teacher-surface-hover);
    color: var(--teacher-text);
}

.chat-mission-toggle:focus {
    outline: none;
}

.chat-mission-toggle:focus-visible {
    box-shadow: 0 0 0 2px var(--teacher-card), 0 0 0 4px var(--teacher-primary);
}

.chat-mission-thread-brief[data-mission-expanded="true"] .chat-mission-toggle i {
    transform: rotate(180deg);
}

.chat-mission-details {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.chat-mission-details-inner {
    padding: 0.5rem 0.75rem 0.625rem;
}

.chat-mission-thread-brief[data-mission-expanded="false"] .chat-mission-details {
    display: none;
}

.chat-mission-objectives-panel {
    padding: 0;
    background: transparent;
    border: 0;
}

/* Learning mission: brief + scroll wrap share the conversation pane */
#chatPage.is-learning-mission .chat-messages-pane {
    display: flex;
    flex-direction: column;
    min-height: 12rem;
}

.chat-messages-scroll-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chat-messages-scroll-wrap > #chatMessages {
    flex: 1 1 auto;
    min-height: 0;
}

html[data-theme="dark"] .chat-mission-thread-brief,
html[data-theme="dark"] .chat-mission-goals-bar {
    background: var(--teacher-card);
    border-bottom-color: var(--teacher-border);
}

html[data-theme="dark"] .chat-thread-surface {
    background: var(--teacher-surface-muted);
    border-color: var(--teacher-border);
}

#chatMissionTranslateBtn.is-active {
    border-color: rgba(29, 158, 117, 0.35);
    background: var(--teacher-primary-soft, #e8f7f1);
    color: var(--teacher-primary-dark, #0f766e);
}

/* Soften objective rows — denser rules live under #chatPage.is-learning-mission */
.mission-objective-card-todo,
.mission-objective-card-progress,
.mission-objective-card-done {
    box-shadow: none;
}

/* Mission thread brief + dock — mobile */
@media (max-width: 639px) {
    #chatPage.is-learning-mission .chat-messages-pane {
        min-height: 10rem;
    }

    .chat-mission-intro-bubble {
        max-width: 100%;
    }

    #chatPage.is-learning-mission .chat-mission-goals-bar {
        padding: 0.1875rem 0.625rem 0.3125rem;
    }

    #chatPage.is-learning-mission #chatMissionThreadBrief:not(.hidden) {
        max-height: none;
        overflow: visible;
    }

    #chatPage.is-learning-mission .chat-mission-details {
        overflow: visible;
    }

    #chatPage.is-learning-mission .chat-mission-details-inner {
        padding: 0.2rem 0.5rem 0.3125rem;
    }

    #chatPage.is-learning-mission .chat-mission-objective-row {
        padding: 0.25rem 0.4375rem;
        gap: 0.4375rem;
    }

    #chatPage.is-learning-mission .chat-mission-objective-title {
        font-size: 0.71875rem;
    }

    #chatMissionConclusionBanner {
        margin-bottom: 0.625rem !important;
        padding: 0.875rem !important;
        border-radius: 1rem !important;
    }

    #chatMissionConclusionIcon {
        width: 2.25rem !important;
        height: 2.25rem !important;
    }

    #chatMissionConclusionTitle {
        line-height: 1.2 !important;
        font-size: 0.875rem !important;
    }

    #chatMissionConclusionSubtitle {
        font-size: 0.78125rem !important;
        line-height: 1.4 !important;
    }

    #chatMissionConclusionSummary {
        gap: 0.375rem !important;
    }

    #chatMissionConclusionSummary > span {
        height: 1.5rem !important;
        padding-left: 0.625rem !important;
        padding-right: 0.625rem !important;
        font-size: 0.75rem !important;
        white-space: nowrap;
    }

    #chatMissionConclusionFeedback {
        margin-top: 0.625rem !important;
        padding: 0.75rem !important;
        border-radius: 0.875rem !important;
        font-size: 0.71875rem !important;
        line-height: 1.5 !important;
    }

    #chatMissionTitle {
        font-size: 0.875rem !important;
        line-height: 1.25 !important;
        word-break: break-word !important;
    }

    #chatMissionSubtitle,
    #chatMissionProgressSummary {
        font-size: 0.75rem !important;
        line-height: 1.35 !important;
    }

    #chatMissionStatusPill {
        height: 1.5rem !important;
        padding-left: 0.625rem !important;
        padding-right: 0.625rem !important;
        font-size: 0.75rem !important;
    }

    #chatMissionTurnCounter {
        font-size: 0.6875rem !important;
        line-height: 1.3 !important;
    }

    #chatMissionReadyBtn,
    #chatMissionBackToUnitBtn,
    #chatMissionRetryBtn {
        width: 100% !important;
        height: 2.875rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        border-radius: 9999px !important;
        font-size: 0.8125rem !important;
    }

    #chatMissionActions {
        gap: 0.5rem !important;
    }
}

@media (max-width: 379px) {
    #chatMissionConclusionSummary > span {
        font-size: 0.625rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    #chatMissionTitle {
        font-size: 0.75rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-mission-toggle,
    .chat-mission-toggle i {
        transition: none;
    }
}

html[data-theme="dark"] #chatPage.is-learning-mission #chatComposerRow {
    background: linear-gradient(180deg, transparent 0%, var(--teacher-card) 28%);
}

/* Live call orb stage — flex-fills the tall chat shell like .chat-messages-pane */
.live-call-orb-canvas {
    display: block;
    margin: 0 auto;
    width: 280px;
    height: 280px;
    max-width: min(80vw, 400px);
    max-height: 400px;
    border-radius: 9999px;
    flex-shrink: 0;
}
@media (min-width: 640px) {
    .live-call-orb-canvas {
        width: 340px;
        height: 340px;
    }
}
#liveCallStage {
    color: #ffffff;
    background:
        radial-gradient(ellipse 60% 50% at 50% 45%, rgba(16, 185, 129, 0.12), transparent 70%),
        #050505;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    max-height: none;
    overflow: hidden;
}
/* When active, grow into the viewport shell (same spirit as messages flex-fill). */
#liveCallStage:not(.hidden) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
#liveCallStage .live-call-stage-inner {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
/* During call: fully hide thread chrome (pane / surface / scroll-wrap / header).
   Previous flex:0 left a ~20px stub from .chat-messages-scroll-wrap + mb-3.
   Ver conversa only toggles #liveCallTranscript under the orb — never reopens this pane.
   Hangup removes .live-call-chat-collapsed and restores the chat thread. */
.chat-messages-pane.live-call-chat-collapsed {
    display: none !important;
    flex: 0 0 0 !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
.chat-desktop-shell.live-call-active .chat-messages-pane:not(.live-call-chat-collapsed) {
    flex: 1 1 auto;
    min-height: 10rem;
}
#liveCallTranscript.live-call-transcript {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    line-height: 1.45;
    word-break: break-word;
}
#liveCallTranscript .live-call-transcript-line + .live-call-transcript-line {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}
#liveCallTranscript .live-call-transcript-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(167, 243, 208, 0.95);
    margin-bottom: 4px;
}
#liveCallTranscript .live-call-transcript-text {
    display: block;
    color: #ffffff;
    font-weight: 600;
}
#chatLiveCallBtn i {
    transform: translateY(1px);
    font-size: 0.875rem;
}

/* --- Songs practice mode --- */
.practice-mode-grid-three {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 768px) {
    .practice-mode-grid-three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.practice-banner-songs {
    border-color: rgba(37, 99, 235, 0.22);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.03)), var(--teacher-card);
}
.practice-banner-icon-box.songs {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}
.practice-banner-button.songs {
    background: #2563eb;
    color: #fff;
}

/* Phrase practice feedback system */
#recordingPage > div:first-child,
#resultsPage > div:first-child {
    border: 1px solid var(--teacher-border);
    border-radius: 20px;
    background: var(--teacher-card);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

#recordingPage:not(.is-word-practice) > div:first-child {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0.25rem 0.25rem 0.75rem;
}

.practice-topic-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.practice-topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--teacher-border, #e5e7eb);
    border-radius: 999px;
    background: var(--teacher-card, #fff);
    color: var(--teacher-text, #0f172a);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.practice-topic-chip:hover {
    border-color: rgba(29, 158, 117, 0.4);
    background: var(--teacher-bg, #f8fafc);
}

.practice-topic-chip.is-active {
    border-color: rgba(29, 158, 117, 0.45);
    background: var(--teacher-primary-soft, #e8f7f1);
    color: var(--teacher-primary-dark, #0f766e);
}

.practice-topic-chip.is-locked {
    opacity: 0.72;
}

.practice-topic-chip-pro {
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--teacher-secondary, #c2410c);
}

.practice-phrase-stepper {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.practice-phrase-stepper-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.practice-phrase-counter {
    margin: 0;
    flex: 1;
    text-align: center;
    color: var(--teacher-text, #0f172a);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.practice-phrase-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    border: 1px solid var(--teacher-border, #e5e7eb);
    border-radius: 0.75rem;
    background: var(--teacher-card, #fff);
    color: var(--teacher-text, #0f172a);
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.practice-phrase-nav:hover:not(:disabled) {
    border-color: rgba(29, 158, 117, 0.4);
    background: var(--teacher-primary-soft, #e8f7f1);
    color: var(--teacher-primary-dark, #0f766e);
}

.practice-phrase-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.practice-phrase-nav:focus-visible,
.practice-phrase-dash:focus-visible,
.practice-topic-chip:focus-visible {
    outline: 2px solid var(--teacher-primary-dark, #0f766e);
    outline-offset: 2px;
}

.practice-phrase-track {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.15rem 0.1rem 0.25rem;
    scrollbar-width: thin;
}

.practice-phrase-dash {
    flex: 1 1 0;
    min-width: 0.7rem;
    max-width: 1.75rem;
    height: 0.35rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #d1d5db;
    transition: background-color 160ms ease, transform 160ms ease;
}

.practice-phrase-dash.is-done {
    background: rgba(29, 158, 117, 0.45);
}

.practice-phrase-dash.is-current {
    background: var(--teacher-primary-dark, #0f766e);
    transform: scaleY(1.35);
}

.practice-phrase-dash:hover {
    background: rgba(29, 158, 117, 0.65);
}

.practice-phrase-meter {
    display: block;
    height: 3px;
    margin-top: 0.55rem;
    border-radius: 999px;
    background: var(--teacher-surface-muted);
    overflow: hidden;
}

.practice-phrase-meter[hidden] {
    display: none;
}

.practice-phrase-meter-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--teacher-primary);
    transition: width 160ms ease;
}

@media (prefers-reduced-motion: reduce) {
    .practice-phrase-meter-fill {
        transition: none;
    }
}

@media (max-width: 639px) {
    .practice-phrase-stepper-bar {
        gap: 0.5rem;
    }

    .practice-phrase-counter {
        font-size: 0.8125rem;
    }

    .practice-phrase-dash {
        min-width: 0.55rem;
        height: 0.3rem;
    }
}

#recordingPage #referenceCard,
#recordingPage .reference-card {
    border: 1px solid rgba(29, 158, 117, 0.18);
    border-radius: 18px;
    background: var(--teacher-primary-soft);
    padding: 1.5rem 1.35rem 1.35rem;
}

/* Word practice (Prática Personalizada) — Calm Practice Studio, list-first */
#recordingPage.is-word-practice #recordingPageHeading {
    display: none;
}

#recordingPage.is-word-practice > div:first-child {
    padding: 1.25rem 1.25rem 1.5rem;
}

.recording-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--teacher-text-secondary);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
}

.recording-back-btn:hover {
    color: var(--teacher-text);
}

.recording-back-btn:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

#recordingPage.is-word-practice > div:first-child > div:first-child {
    margin-bottom: 0.75rem;
}

#recordingPage.is-word-practice #referenceCard,
#recordingPage.is-word-practice .reference-card {
    background:
        linear-gradient(165deg, var(--teacher-primary-soft) 0%, var(--teacher-card) 52%, var(--teacher-bg) 100%);
    border-color: rgba(29, 158, 117, 0.22);
    padding: 1.35rem 1.2rem 1.25rem;
    min-height: 0;
    margin-bottom: 0;
}

#recordingPage.is-word-practice #referenceCard #referenceText,
#recordingPage.is-word-practice #referenceCard .reference-phrase {
    max-width: none;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: normal;
    color: inherit;
    text-wrap: pretty;
}

#recordingPage.is-word-practice .word-practice-studio {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#recordingPage.is-word-practice .word-practice-lead {
    margin: 0;
    max-width: 36rem;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.45;
    color: #4d6b60;
}

#recordingPage.is-word-practice .word-practice-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: min(34rem, calc(100vh - 14rem));
    overflow-y: auto;
    padding: 0.1rem 0.15rem 0.1rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 110, 86, 0.35) transparent;
}

#recordingPage.is-word-practice .word-practice-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(29, 158, 117, 0.16);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--teacher-card) 88%, var(--teacher-primary-soft));
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

#recordingPage.is-word-practice .word-practice-item:hover {
    border-color: rgba(29, 158, 117, 0.32);
    background: var(--teacher-card);
}

#recordingPage.is-word-practice .word-practice-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 0.85rem;
    flex-wrap: wrap;
}

#recordingPage.is-word-practice .word-practice-item-text {
    flex: 1 1 10rem;
    min-width: 0;
}

#recordingPage.is-word-practice .word-practice-item-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.55rem;
    min-width: 0;
}

#recordingPage.is-word-practice .word-practice-word {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--teacher-text);
}

#recordingPage.is-word-practice .word-practice-translation {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4d6b60;
}

#recordingPage.is-word-practice .word-practice-translation::before {
    content: "·";
    margin-right: 0.45rem;
    color: rgba(15, 110, 86, 0.4);
}

#recordingPage.is-word-practice .word-practice-guide {
    margin-top: 0.1rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.01em;
    color: #5f7a70;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#recordingPage.is-word-practice .word-practice-status {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--teacher-text-secondary);
}

#recordingPage.is-word-practice .word-practice-status.is-great { color: var(--teacher-primary-dark); }
#recordingPage.is-word-practice .word-practice-status.is-good { color: #0f766e; }
#recordingPage.is-word-practice .word-practice-status.is-ok { color: #b45309; }
#recordingPage.is-word-practice .word-practice-status.is-low { color: #b91c1c; }

#recordingPage.is-word-practice .word-practice-status-idle {
    font-weight: 600;
    color: #5f7a70;
}

#recordingPage.is-word-practice .word-practice-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    margin-left: auto;
}

#recordingPage.is-word-practice .word-practice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 2.75rem;
    padding: 0 0.85rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

#recordingPage.is-word-practice .word-practice-btn .ti {
    font-size: 1.05em;
}

#recordingPage.is-word-practice .word-practice-btn--train {
    background: var(--teacher-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 1px 2px rgba(15, 110, 86, 0.28);
}

#recordingPage.is-word-practice .word-practice-btn--train:hover {
    background: var(--teacher-primary-dark);
}

#recordingPage.is-word-practice .word-practice-btn--listen,
#recordingPage.is-word-practice .word-practice-btn--secondary {
    background: var(--teacher-card);
    color: var(--teacher-primary-dark);
    border-color: rgba(29, 158, 117, 0.3);
}

#recordingPage.is-word-practice .word-practice-btn--listen:hover,
#recordingPage.is-word-practice .word-practice-btn--secondary:hover {
    background: var(--teacher-primary-soft);
}

#recordingPage.is-word-practice .word-practice-btn--ghost {
    background: transparent;
    color: #3f5f54;
    border-color: rgba(15, 23, 42, 0.1);
}

#recordingPage.is-word-practice .word-practice-btn--ghost:hover {
    background: var(--teacher-surface-muted);
}

#recordingPage.is-word-practice .word-practice-btn--stop {
    background: #fff1f2;
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.22);
    box-shadow: none;
}

#recordingPage.is-word-practice .word-practice-btn--stop:hover {
    background: #ffe4e6;
    color: #991b1b;
}

#recordingPage.is-word-practice .word-practice-btn:focus-visible,
#recordingPage.is-word-practice .word-practice-icon-btn:focus-visible,
#recordingPage.is-word-practice .word-practice-input:focus-visible,
#recordingPage.is-word-practice .word-practice-add-summary:focus-visible {
    outline: 2px solid var(--teacher-primary-dark);
    outline-offset: 2px;
}

#recordingPage.is-word-practice .word-practice-manage {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

#recordingPage.is-word-practice .word-practice-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    border: 1px solid var(--teacher-border);
    background: transparent;
    color: #5f7a70;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

#recordingPage.is-word-practice .word-practice-icon-btn:hover {
    background: var(--teacher-surface-hover);
    color: var(--teacher-text);
}

#recordingPage.is-word-practice .word-practice-icon-btn--danger:hover {
    background: #fff1f2;
    border-color: rgba(185, 28, 28, 0.2);
    color: #b91c1c;
}

#recordingPage.is-word-practice .word-practice-meter {
    margin-top: 0.15rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(29, 158, 117, 0.2);
    background: var(--teacher-primary-soft);
}

#recordingPage.is-word-practice .word-practice-meter-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--teacher-primary-dark);
}

#recordingPage.is-word-practice .word-practice-meter-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 9999px;
    background: var(--teacher-primary);
    box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.18);
}

#recordingPage.is-word-practice .word-practice-wave {
    display: flex;
    align-items: flex-end;
    gap: 0.2rem;
    height: 2.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(29, 158, 117, 0.14);
    background: color-mix(in srgb, var(--teacher-card) 80%, transparent);
}

#recordingPage.is-word-practice .word-practice-feedback-card {
    padding: 0.75rem 0.85rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(29, 158, 117, 0.16);
    background: var(--teacher-surface-muted);
}

#recordingPage.is-word-practice .word-practice-feedback-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

#recordingPage.is-word-practice .word-practice-feedback-captured {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--teacher-text);
}

#recordingPage.is-word-practice .word-practice-feedback-score {
    font-size: 0.8125rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

#recordingPage.is-word-practice .word-practice-feedback-label {
    margin-top: 0.45rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5f7a70;
}

#recordingPage.is-word-practice .word-practice-feedback-guide {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

#recordingPage.is-word-practice .word-practice-feedback-guide--expected {
    color: var(--teacher-primary-dark);
}

#recordingPage.is-word-practice .word-practice-feedback-guide--heard {
    color: #b45309;
}

#recordingPage.is-word-practice .word-practice-feedback-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

#recordingPage.is-word-practice .word-practice-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0 0.55rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
}

#recordingPage.is-word-practice .word-practice-badge--swap {
    background: rgba(239, 159, 39, 0.18);
    color: #92400e;
}

#recordingPage.is-word-practice .word-practice-badge--miss {
    background: #fff1f2;
    color: #b91c1c;
}

#recordingPage.is-word-practice .word-practice-badge--extra {
    background: var(--teacher-surface-hover);
    color: #3f5f54;
}

#recordingPage.is-word-practice .word-practice-feedback-hint {
    margin: 0.55rem 0 0;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    color: #4d6b60;
}

#recordingPage.is-word-practice .word-practice-empty {
    padding: 1.25rem 1.1rem;
    border-radius: 1rem;
    border: 1px dashed rgba(29, 158, 117, 0.35);
    background: color-mix(in srgb, var(--teacher-primary-soft) 55%, var(--teacher-card));
}

#recordingPage.is-word-practice .word-practice-empty-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--teacher-primary-dark);
}

#recordingPage.is-word-practice .word-practice-empty-copy {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
    color: #4d6b60;
}

#recordingPage.is-word-practice .word-practice-add {
    border: 1px solid rgba(29, 158, 117, 0.16);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--teacher-card) 92%, var(--teacher-primary-soft));
    overflow: hidden;
}

#recordingPage.is-word-practice .word-practice-add-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--teacher-primary-dark);
}

#recordingPage.is-word-practice .word-practice-add-summary::-webkit-details-marker {
    display: none;
}

#recordingPage.is-word-practice .word-practice-add-summary-text {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

#recordingPage.is-word-practice .word-practice-add-chevron {
    transition: transform 160ms ease;
}

#recordingPage.is-word-practice .word-practice-add[open] .word-practice-add-chevron {
    transform: rotate(180deg);
}

#recordingPage.is-word-practice .word-practice-add-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1rem 1rem;
}

#recordingPage.is-word-practice .word-practice-add-hint {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4d6b60;
}

#recordingPage.is-word-practice .word-practice-add-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    #recordingPage.is-word-practice .word-practice-add-fields {
        grid-template-columns: 1fr 1fr;
    }
}

#recordingPage.is-word-practice .word-practice-input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--teacher-border-strong);
    border-radius: 0.85rem;
    background: var(--teacher-card);
    color: var(--teacher-text);
    font-size: 0.9375rem;
    font-weight: 500;
}

#recordingPage.is-word-practice .word-practice-input::placeholder {
    color: #6b857a;
}

#recordingPage.is-word-practice .word-practice-add-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 639px) {
    #recordingPage.is-word-practice #referenceCard,
    #recordingPage.is-word-practice .reference-card {
        padding: 1.15rem 1rem 1.1rem;
    }

    #recordingPage.is-word-practice .word-practice-list {
        max-height: min(28rem, calc(100vh - 12rem));
    }

    #recordingPage.is-word-practice .word-practice-item {
        padding: 0.5rem 0.65rem;
    }

    #recordingPage.is-word-practice .word-practice-item-row {
        align-items: stretch;
    }

    #recordingPage.is-word-practice .word-practice-actions {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    #recordingPage.is-word-practice .word-practice-btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    #recordingPage.is-word-practice .word-practice-icon-btn {
        width: 2.75rem;
        height: 2.75rem;
    }

    #recordingPage.is-word-practice .word-practice-manage {
        margin-left: auto;
    }
}

@media (min-width: 640px) {
    #recordingPage.is-word-practice .word-practice-item-row {
        flex-wrap: nowrap;
    }

    #recordingPage.is-word-practice .word-practice-btn {
        min-height: 2.5rem;
        padding: 0 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    #recordingPage.is-word-practice .word-practice-item,
    #recordingPage.is-word-practice .word-practice-btn,
    #recordingPage.is-word-practice .word-practice-icon-btn,
    #recordingPage.is-word-practice .word-practice-add-chevron {
        transition: none;
    }
}

html[data-theme="dark"] #recordingPage.is-word-practice .word-practice-lead,
html[data-theme="dark"] #recordingPage.is-word-practice .word-practice-translation,
html[data-theme="dark"] #recordingPage.is-word-practice .word-practice-guide,
html[data-theme="dark"] #recordingPage.is-word-practice .word-practice-status-idle,
html[data-theme="dark"] #recordingPage.is-word-practice .word-practice-add-hint,
html[data-theme="dark"] #recordingPage.is-word-practice .word-practice-empty-copy,
html[data-theme="dark"] #recordingPage.is-word-practice .word-practice-feedback-hint,
html[data-theme="dark"] #recordingPage.is-word-practice .word-practice-feedback-label {
    color: var(--teacher-text-secondary);
}

html[data-theme="dark"] #recordingPage.is-word-practice .word-practice-item {
    background: color-mix(in srgb, var(--teacher-card) 88%, var(--teacher-primary-soft));
}

html[data-theme="dark"] #recordingPage.is-word-practice .word-practice-btn--ghost {
    color: var(--teacher-text-secondary);
}

#recordingPage #referenceCard .reference-card-label,
#recordingPage #referenceCard h3.reference-card-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.3;
    color: var(--teacher-primary-dark);
}

#recordingPage #referenceCard .reference-card-label .ti {
    font-size: 0.95em;
    opacity: 0.85;
}

/* English practice sentence — visual hero of the card */
#recordingPage #referenceCard #referenceText,
#recordingPage #referenceCard .reference-phrase {
    margin: 0.15rem 0 0;
    max-width: 36rem;
    font-size: clamp(1.35rem, 2.6vw + 0.85rem, 1.85rem);
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: -0.02em;
    color: var(--teacher-text);
    text-wrap: pretty;
}

#recordingPage #referenceCard #referenceText.word-by-word .clickable-word {
    padding: 0.06em 0.1em;
    margin: 0 0.02em;
    border-radius: 0.3em;
}

#recordingPage #referenceCard #referenceText.word-by-word .clickable-word:hover {
    background-color: rgba(15, 110, 86, 0.1);
    transform: translateY(-1px);
}

#recordingPage #referenceCard #referenceText.word-by-word .word-speaking {
    background-color: rgba(29, 158, 117, 0.16);
    color: var(--teacher-primary-dark);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(15, 110, 86, 0.12);
}

#recordingPage #referenceCard .reference-translation,
#recordingPage #referenceCard #practiceTranslation {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.45;
    /* Secondary on mint surface — hue-tinted, not flat gray */
    color: #4d6b60;
}

/* Dark mint card: #4d6b60 is too dim (~2:1). Off-white mint stays secondary to English. */
html[data-theme="dark"] #recordingPage #referenceCard .reference-translation,
html[data-theme="dark"] #recordingPage #referenceCard #practiceTranslation {
    color: #D4ECE2;
}

@media (max-width: 639px) {
    #recordingPage #referenceCard,
    #recordingPage .reference-card {
        padding: 1.25rem 1.1rem 1.15rem;
    }

    #recordingPage #referenceCard #referenceText,
    #recordingPage #referenceCard .reference-phrase {
        font-size: clamp(1.25rem, 4.2vw + 0.7rem, 1.55rem);
        line-height: 1.4;
        letter-spacing: -0.015em;
    }
}

#recordingPage #speakBtn,
#recordingPage #recordBtn {
    border: 0;
    background: var(--teacher-primary-dark);
    color: #fff;
}

#recordingPage #speakBtn {
    background: var(--teacher-card);
    color: var(--teacher-primary-dark);
    border: 1px solid rgba(29, 158, 117, 0.3);
}

#recordingPage #recordBtn:hover,
#recordingPage #speakBtn:hover {
    background: var(--teacher-primary-dark);
    color: #fff;
}

/* Phrase recording studio — composition matches practice mock, Teacher AI tokens */
#recordingPage {
    --teacher-recording: #E05656;
    --teacher-recording-soft: rgba(224, 86, 86, 0.18);
}

html[data-theme="dark"] #recordingPage {
    --teacher-recording: #F07167;
    --teacher-recording-soft: rgba(240, 113, 103, 0.22);
}

body:has(#recordingPage:not(.hidden):not(.is-word-practice)) .app-main-shell {
    padding-top: 0.75rem;
    padding-bottom: 6.5rem;
}

#recordingPage:not(.is-word-practice) .recording-studio {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 8.5rem);
    max-width: 40rem;
    margin: 0 auto;
}

#recordingPage:not(.is-word-practice) .recording-studio-header {
    flex: 0 0 auto;
}

#recordingPage:not(.is-word-practice) .recording-studio-nav {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
}

#recordingPage:not(.is-word-practice) .recording-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 0.85rem;
    background: transparent;
    color: var(--teacher-text);
    font-size: 0;
    line-height: 1;
}

#recordingPage:not(.is-word-practice) .recording-back-btn span {
    display: none;
}

#recordingPage:not(.is-word-practice) .recording-back-btn .ti {
    font-size: 1.35rem;
}

#recordingPage:not(.is-word-practice) .recording-back-btn:hover {
    background: var(--teacher-surface-hover);
}

#recordingPage:not(.is-word-practice) .recording-back-btn:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

#recordingPage:not(.is-word-practice) .recording-studio-heading {
    margin: 0;
    text-align: center;
}

#recordingPage:not(.is-word-practice) #currentUnitTitle {
    margin: 0;
    color: var(--teacher-text);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

#recordingPage:not(.is-word-practice) .recording-studio-nav-spacer {
    width: 2.75rem;
    height: 2.75rem;
}

#recordingPage:not(.is-word-practice) #sentenceSelection {
    margin: 0.15rem 0 0;
}

#recordingPage:not(.is-word-practice) .practice-phrase-stepper {
    gap: 0;
}

#recordingPage:not(.is-word-practice) .practice-phrase-counter {
    color: var(--teacher-text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
}

#recordingPage:not(.is-word-practice) .practice-phrase-nav {
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    background: transparent;
}

#recordingPage:not(.is-word-practice) .practice-phrase-nav:hover:not(:disabled) {
    background: var(--teacher-surface-hover);
}

#recordingPage:not(.is-word-practice) .practice-phrase-track {
    display: none;
}

#recordingPage:not(.is-word-practice) .recording-studio-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#recordingPage:not(.is-word-practice) .recording-phrase {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 1.75rem 0.25rem 1rem;
}

#recordingPage.is-expressions-practice .recording-phrase {
    display: none;
}

#recordingPage.is-expressions-practice .recording-studio {
    min-height: 0;
}

#recordingPage:not(.is-word-practice) #referenceCard,
#recordingPage:not(.is-word-practice) .reference-card {
    border: 0;
    background: transparent;
    padding: 0.25rem 0.5rem;
    text-align: center;
}

#recordingPage:not(.is-word-practice) #referenceCard .reference-card-label,
#recordingPage:not(.is-word-practice) #referenceCard h3.reference-card-label {
    display: block;
    margin: 0 0 0.85rem;
    color: var(--teacher-text-secondary);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

#recordingPage:not(.is-word-practice) #referenceCard #referenceText,
#recordingPage:not(.is-word-practice) #referenceCard .reference-phrase {
    margin: 0 auto;
    max-width: 22rem;
    color: var(--teacher-text);
    font-size: clamp(1.65rem, 4.8vw + 0.7rem, 2.15rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

#recordingPage:not(.is-word-practice) #referenceCard .reference-translation,
#recordingPage:not(.is-word-practice) #referenceCard #practiceTranslation {
    margin: 0.7rem auto 0;
    max-width: 22rem;
    color: #4d6b60;
    font-size: 1rem;
    font-weight: 500;
    font-style: normal;
    line-height: 1.4;
}

html[data-theme="dark"] #recordingPage:not(.is-word-practice) #referenceCard .reference-translation,
html[data-theme="dark"] #recordingPage:not(.is-word-practice) #referenceCard #practiceTranslation {
    color: #D4ECE2;
}

#recordingPage:not(.is-word-practice) #referenceAudioControls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.7rem;
    margin-top: 1.35rem;
}

#recordingPage:not(.is-word-practice) #speakBtn,
#recordingPage:not(.is-word-practice) .recording-listen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    padding: 0 1.05rem;
    border-radius: 999px;
    border: 1px solid rgba(29, 158, 117, 0.38);
    background: var(--teacher-card);
    color: var(--teacher-primary-dark);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
}

#recordingPage:not(.is-word-practice) #speakBtn .ti {
    font-size: 1.05rem;
}

#recordingPage:not(.is-word-practice) #speakBtn:hover,
#recordingPage:not(.is-word-practice) .recording-listen-btn:hover {
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
}

#recordingPage:not(.is-word-practice) #speakBtn.is-speaking {
    background: var(--teacher-primary-soft);
}

#recordingPage:not(.is-word-practice) #speakBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#recordingPage:not(.is-word-practice) #speakBtn:focus-visible,
#recordingPage:not(.is-word-practice) .speech-rate-chip:focus-visible,
#recordingPage:not(.is-word-practice) .recording-mic-btn:focus-visible,
#recordingPage:not(.is-word-practice) .recording-cancel-btn:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

#recordingPage:not(.is-word-practice) .speech-rate-chips {
    display: inline-flex;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.2rem;
    border: 1px solid var(--teacher-border-strong);
    border-radius: 999px;
    background: var(--teacher-card);
}

#recordingPage:not(.is-word-practice) .speech-rate-chip {
    min-height: 2.25rem;
    padding: 0 1rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--teacher-text-secondary);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
}

#recordingPage:not(.is-word-practice) .speech-rate-chip.is-active {
    background: var(--teacher-surface-muted);
    color: var(--teacher-text);
}

#recordingPage:not(.is-word-practice) .speech-rate-chip:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#recordingPage:not(.is-word-practice) .recording-dock {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0 0.5rem;
}

#recordingPage:not(.is-word-practice) #recordingControls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#recordingPage:not(.is-word-practice) #audioVisualization,
#recordingPage:not(.is-word-practice) .recording-eq {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 20rem;
    margin: 0 0 0.85rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

#recordingPage:not(.is-word-practice) #audioVisualization.hidden,
#recordingPage:not(.is-word-practice) #recordBtn.hidden,
#recordingPage:not(.is-word-practice) #stopBtn.hidden,
#recordingPage:not(.is-word-practice) .recording-cancel-btn.hidden {
    display: none;
}

#recordingPage:not(.is-word-practice) #waveform {
    width: 100%;
    min-height: 3.25rem;
    padding: 0;
}

#recordingPage:not(.is-word-practice) #waveform .wave-bar {
    background-color: var(--teacher-recording);
    width: 3px;
    border-radius: 999px;
}

#recordingPage:not(.is-word-practice) .recording-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.65rem 0 0;
    color: var(--teacher-recording);
    font-size: 0.9375rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

#recordingPage:not(.is-word-practice) .recording-timer-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--teacher-recording);
    box-shadow: 0 1px 2px rgba(185, 28, 28, 0.25);
}

#recordingPage.is-recording:not(.is-word-practice) .recording-timer-dot {
    animation: recording-timer-pulse 1.2s ease-in-out infinite;
}

@keyframes recording-timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
    #recordingPage.is-recording:not(.is-word-practice) .recording-timer-dot {
        animation: none;
    }
}

#recordingPage:not(.is-word-practice) #recordBtn,
#recordingPage:not(.is-word-practice) #stopBtn,
#recordingPage:not(.is-word-practice) .recording-mic-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5.25rem;
    height: 5.25rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--teacher-primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(15, 110, 86, 0.28);
}

#recordingPage:not(.is-word-practice) #recordBtn .ti {
    font-size: 1.85rem;
}

#recordingPage:not(.is-word-practice) #recordBtn:hover:not(:disabled),
#recordingPage:not(.is-word-practice) .recording-mic-btn:hover:not(:disabled):not(.recording-mic-btn--stop) {
    background: var(--teacher-primary-dark);
    color: #fff;
}

#recordingPage:not(.is-word-practice) #recordBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

#recordingPage:not(.is-word-practice) #stopBtn,
#recordingPage:not(.is-word-practice) .recording-mic-btn--stop {
    background: var(--teacher-recording);
    color: #fff;
    border: 6px solid var(--teacher-recording-soft);
    box-shadow: 0 8px 18px rgba(185, 28, 28, 0.22);
}

#recordingPage:not(.is-word-practice) #stopBtn:hover,
#recordingPage:not(.is-word-practice) .recording-mic-btn--stop:hover {
    background: #c94a4a;
    color: #fff;
}

#recordingPage:not(.is-word-practice) .recording-stop-square {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 0.22rem;
    background: #fff;
}

#recordingPage:not(.is-word-practice) .recording-mic-label {
    margin: 0.85rem 0 0;
    color: var(--teacher-text);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.2;
}

#recordingPage:not(.is-word-practice) .recording-mic-hint {
    margin: 0.35rem 0 0;
    color: var(--teacher-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
}

#recordingPage:not(.is-word-practice) .recording-mic-hint[hidden] {
    display: none;
}

#recordingPage:not(.is-word-practice) .recording-cancel-btn {
    margin-top: 0.15rem;
    min-height: 2.75rem;
    padding: 0 0.85rem;
    border: 0;
    background: transparent;
    color: var(--teacher-text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
}

#recordingPage:not(.is-word-practice) .recording-cancel-btn:hover {
    color: var(--teacher-text);
}

#recordingPage:not(.is-word-practice) .recording-status {
    margin-top: 0.75rem;
    text-align: center;
    color: var(--teacher-text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
}

#recordingPage:not(.is-word-practice) #textInputSection {
    margin: 0.75rem 0 0;
}

#recordingPage:not(.is-word-practice) #textInputSection label {
    color: var(--teacher-text);
    font-size: 0.8125rem;
    font-weight: 700;
}

#recordingPage:not(.is-word-practice) #customText {
    border-color: var(--teacher-border-strong);
    border-radius: 1rem;
    background: var(--teacher-card);
    color: var(--teacher-text);
}

#recordingPage:not(.is-word-practice) #customText:focus {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
    border-color: transparent;
}

#recordingPage:not(.is-word-practice) #setCustomTextBtn {
    min-height: 2.5rem;
    padding: 0 1.1rem;
    border: 0;
    border-radius: 999px;
    background: var(--teacher-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
}

#recordingPage:not(.is-word-practice) #setCustomTextBtn:hover {
    background: var(--teacher-primary-dark);
}

#recordingPage:not(.is-word-practice)::selection,
#recordingPage:not(.is-word-practice) *::selection {
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
}

@media (max-width: 639px) {
    #recordingPage:not(.is-word-practice) #referenceCard #referenceText,
    #recordingPage:not(.is-word-practice) #referenceCard .reference-phrase {
        font-size: clamp(1.5rem, 6vw + 0.55rem, 1.9rem);
        max-width: 100%;
    }

    #recordingPage:not(.is-word-practice) .recording-phrase {
        padding-top: 1.35rem;
    }
}

#resultsPage > div:first-child {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0.15rem 0 0.5rem;
}

#resultsPage #resultsTextComparison.results-compare-sheet {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1rem 1.1rem 1.15rem;
    border-radius: 1.125rem;
    background: var(--teacher-card);
    border: 1px solid var(--teacher-border);
}

.results-compare-block {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    position: relative;
}

#resultsPage #resultsScreenA .results-compare-block--heard {
    display: none;
}

.results-compare-label {
    margin: 0;
    color: var(--teacher-text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.3;
}

.results-compare-heard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.results-icon-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border: 1px solid rgba(29, 158, 117, 0.28);
    border-radius: 9999px;
    background: var(--teacher-card);
    color: var(--teacher-primary-dark);
    transition: background-color 150ms ease, border-color 150ms ease;
}

.results-icon-play-btn:hover {
    background: var(--teacher-primary-soft);
    border-color: rgba(29, 158, 117, 0.4);
}

.results-icon-play-btn:focus-visible,
.results-inline-play-btn:focus-visible,
.results-word-feedback-entry:focus-visible,
.results-back-btn:focus-visible,
.results-action-secondary:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

#resultsPage .results-listen-btn:focus-visible,
#resultsPage .results-action-primary:focus-visible {
    outline: 2px solid var(--teacher-text);
    outline-offset: 2px;
}

.results-inline-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    gap: 0.375rem;
    min-height: 2.25rem;
    padding: 0 0.85rem;
    margin-top: 0.55rem;
    border: 1px solid rgba(29, 158, 117, 0.28);
    border-radius: 9999px;
    background: var(--teacher-card);
    color: var(--teacher-primary-dark);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.results-inline-play-btn:hover {
    background: #fff;
    border-color: rgba(29, 158, 117, 0.45);
}

#resultsPage .results-listen-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin-top: 0.35rem;
}

#resultsPage .results-listen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0 0.7rem;
    border: 1px solid var(--teacher-border-strong);
    border-radius: 0.9rem;
    background: var(--teacher-card);
    color: var(--teacher-text);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

#resultsPage .results-listen-btn i {
    color: var(--teacher-text-secondary);
    font-size: 0.95rem;
}

#resultsPage .results-listen-btn:hover,
#resultsPage .results-listen-btn:active {
    background: var(--teacher-surface-hover);
    border-color: var(--teacher-border-strong);
    color: var(--teacher-text);
}

#resultsPage .results-listen-btn:hover i,
#resultsPage .results-listen-btn:active i {
    color: var(--teacher-text);
}

.results-recorded-audio {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#resultsPage #translationText,
#resultsPage .results-compare-translation {
    margin: 0.15rem 0 0;
    color: var(--teacher-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    font-style: normal;
    line-height: 1.4;
}

#resultsPage #translationText:empty {
    display: none;
}

#resultsPage #referenceGuideText,
#resultsPage #recognizedGuideText {
    display: none;
}

#resultsPage #resultsScreenA .results-phrase,
#resultsPage .results-mini-compare .results-phrase {
    display: block;
}

#resultsPage #highlightedReferenceText span:hover {
    background-color: transparent;
    transform: none;
}

#resultsPage .results-word {
    display: inline;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-weight: 700;
    line-height: inherit;
    box-decoration-break: clone;
}

#resultsPage .results-word.is-correct {
    color: var(--teacher-primary-dark);
    background: transparent;
}

#resultsPage .results-word.is-sub {
    color: #8A4B00;
}

#resultsPage .results-word.is-missing {
    color: #9B1C1C;
    text-decoration: line-through;
}

#resultsPage .results-word.is-extra {
    color: var(--teacher-text-secondary);
    background: transparent;
    text-decoration: line-through;
    font-weight: 600;
}

#resultsPage .results-mini-compare .results-word {
    font-size: inherit;
}

#resultsPage #resultsScreenA.is-match #resultsCoachBlock {
    display: none;
}

@media (min-width: 640px) {
    #resultsPage .results-phrase {
        font-size: 1.25rem;
    }
}

.results-score-cluster {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#resultsPage .results-score-cluster {
    padding: 1rem 1.15rem;
    border-radius: 1.125rem;
    background: var(--teacher-surface-muted);
}

#resultsPage .results-score-cluster:has(.results-score-ring.is-high) {
    background: var(--teacher-primary-soft);
}

.results-score-ring {
    --score: 0;
    position: relative;
    flex: 0 0 auto;
    width: 5.25rem;
    height: 5.25rem;
}

.results-score-ring-svg {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.results-score-ring-track,
.results-score-ring-arc {
    fill: none;
    stroke-width: 9;
    stroke-linecap: round;
}

.results-score-ring-track {
    stroke: color-mix(in srgb, var(--teacher-text) 16%, transparent);
}

.results-score-ring.is-high .results-score-ring-track {
    stroke: color-mix(in srgb, var(--teacher-primary-dark) 28%, transparent);
}

.results-score-ring-arc {
    stroke: var(--teacher-amber);
    stroke-dasharray: var(--score), 100;
    transition: stroke-dasharray 200ms ease-out, stroke 160ms ease-out;
}

.results-score-ring.is-low .results-score-ring-arc,
.results-score-ring.is-mid .results-score-ring-arc {
    stroke: var(--teacher-amber);
}

.results-score-ring.is-high .results-score-ring-arc {
    stroke: var(--teacher-primary);
}

.results-score-ring.is-complete .results-score-ring-arc {
    stroke-dasharray: 100, 0;
    stroke-linecap: butt;
}

.results-score-ring.is-zero .results-score-ring-arc {
    opacity: 0;
}

.results-score-ring-hole {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: transparent;
    pointer-events: none;
}

html[data-theme="dark"] .results-score-ring-track {
    stroke: color-mix(in srgb, var(--teacher-text) 22%, transparent);
}

html[data-theme="dark"] .results-score-ring.is-high .results-score-ring-track {
    stroke: color-mix(in srgb, var(--teacher-primary) 34%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .results-score-ring-arc {
        transition: none;
    }
}

.results-progress-value {
    margin: 0;
    color: var(--teacher-text);
    font-size: 1.65rem;
    line-height: 1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.results-score-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.results-score-headline {
    margin: 0;
    color: var(--teacher-text);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
}

.results-score-summary {
    margin: 0.3rem 0 0;
    color: var(--teacher-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.results-prev-hint {
    margin: 0.35rem 0 0;
    color: var(--teacher-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.35;
}

.results-coach {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.1rem 1.1rem;
    border-radius: 1rem;
    background: var(--teacher-primary-soft);
}

.results-coach .results-compare-label {
    color: var(--teacher-primary-dark);
}

.results-coach-detail {
    margin: 0.35rem 0 0;
    color: #3d5c52;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
}

.results-coach-detail:empty {
    display: none;
}

.results-word-feedback-entry {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.25rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(29, 158, 117, 0.22);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--teacher-primary-soft) 58%, var(--teacher-card));
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    color: var(--teacher-text);
    text-align: left;
    transition: border-color 140ms ease, background-color 140ms ease;
}

.results-word-feedback-entry:hover {
    border-color: rgba(29, 158, 117, 0.36);
    background: color-mix(in srgb, var(--teacher-primary-soft) 78%, var(--teacher-card));
}

.results-word-feedback-entry-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background: var(--teacher-card);
    color: var(--teacher-primary-dark);
    font-size: 1.05rem;
}

.results-word-feedback-entry-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
    flex: 1 1 auto;
}

.results-word-feedback-entry-label {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.25;
}

.results-word-feedback-entry-benefit {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    color: #3d5c52;
}

.results-word-feedback-entry-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--teacher-primary-dark);
    flex-shrink: 0;
}

.results-pro-badge {
    display: inline-flex;
    align-items: center;
    height: 1.5rem;
    padding: 0 0.55rem;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--teacher-primary-dark);
    background: var(--teacher-card);
    border: 1px solid rgba(29, 158, 117, 0.28);
    border-radius: 9999px;
}

.results-pro-badge.hidden,
#advancedFeedbackLock.hidden,
#advancedFeedbackChevron.hidden {
    display: none;
}

html[data-theme="dark"] .results-word-feedback-entry-benefit {
    color: var(--teacher-text-secondary);
}

@media (max-width: 639px) {
    .results-word-feedback-entry {
        align-items: flex-start;
        padding: 0.7rem 0.75rem;
    }

    .results-word-feedback-entry-meta {
        align-self: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .results-word-feedback-entry {
        transition: none;
    }
}

.results-word-feedback-top {
    margin-bottom: 1rem;
}

.results-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--teacher-primary-dark);
    font-size: 0.9375rem;
    font-weight: 700;
}

.results-mini-compare {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: var(--teacher-surface-muted);
}

.results-mini-compare-row {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr);
    gap: 0.6rem;
    align-items: baseline;
    margin: 0;
}

.results-mini-compare-label {
    color: var(--teacher-text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
}

.results-mini-compare .results-phrase {
    font-size: 0.9375rem;
}

.results-tips-card {
    padding: 0 1.25rem;
    border: 0;
    background: transparent;
}

#resultsWordAnalysisCard {
    padding: 0 1.25rem;
}

@media (min-width: 640px) {
    .results-tips-card,
    #resultsWordAnalysisCard {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.results-tips-card-title {
    margin: 0 0 0.5rem;
    color: var(--teacher-text);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.results-tip-item {
    margin: 0 0 0.4rem;
    color: var(--teacher-text);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
    padding-left: 1.15rem;
    position: relative;
}

.results-tip-item:last-child {
    margin-bottom: 0;
}

.results-tip-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.4rem;
    width: 0.55rem;
    height: 0.3rem;
    border-left: 2px solid var(--teacher-primary-dark);
    border-bottom: 2px solid var(--teacher-primary-dark);
    transform: rotate(-45deg);
}

.results-tip-item i {
    display: none;
}

.results-tip-fallback {
    margin: 0;
    color: var(--teacher-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
}

.results-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.results-stat-card {
    padding: 0.7rem 0.4rem;
    border-radius: 0.75rem;
    background: var(--teacher-surface-muted);
    text-align: center;
}

.results-stat-card.hidden,
.results-stat-card[hidden] {
    display: none;
}

.results-stat-value {
    color: var(--teacher-text);
    font-size: 1.25rem;
    line-height: 1.2;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.results-stat-label {
    margin-top: 0.15rem;
    color: var(--teacher-text-secondary);
    font-size: 0.6875rem;
    line-height: 1.2;
    font-weight: 700;
}

.results-word-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--teacher-border);
}

.results-word-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 3rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--teacher-border);
}

.results-word-row--mismatch {
    display: block;
    padding: 0;
}

.results-word-row-summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 3rem;
    padding: 0.7rem 0;
    cursor: pointer;
    list-style: none;
}

.results-word-row-summary::-webkit-details-marker,
.results-word-row-summary::marker {
    display: none;
    content: none;
}

.results-word-row-summary::after {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    margin-left: 0.15rem;
    border-right: 2px solid var(--teacher-text-secondary);
    border-bottom: 2px solid var(--teacher-text-secondary);
    transform: rotate(45deg);
    flex-shrink: 0;
}

details[open] > .results-word-row-summary::after {
    transform: rotate(-135deg);
}

.results-word-row-term {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--teacher-text);
    font-size: 1rem;
    font-weight: 700;
}

.results-word-row-ok {
    color: var(--teacher-primary-dark);
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}

.results-word-row-flag {
    color: #8A4B00;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}

.results-word-row-listen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: var(--teacher-text-secondary);
}

.results-word-row-panel {
    padding: 0 0 0.9rem;
}

.results-word-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.results-word-pair-col {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.75rem;
    border-radius: 0.75rem;
}

.results-word-pair-col--expected {
    background: var(--teacher-primary-soft);
}

.results-word-pair-col--heard {
    background: rgba(239, 159, 39, 0.16);
}

.results-word-pair-label {
    color: var(--teacher-text-secondary);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.results-word-pair-word {
    color: var(--teacher-text);
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.2;
}

.results-word-pair-ipa {
    color: var(--teacher-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
}

.results-word-pair-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.results-word-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.results-word-listen {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0 0.7rem;
    border: 1px solid var(--teacher-border-strong);
    border-radius: 9999px;
    background: var(--teacher-card);
    color: var(--teacher-text);
    font-weight: 700;
}

html[data-theme="dark"] .results-coach-detail,
html[data-theme="dark"] #resultsPage #translationText,
html[data-theme="dark"] #resultsPage .results-compare-translation {
    color: #D4ECE2;
}

html[data-theme="dark"] .results-word-row-flag {
    color: #F3C56B;
}

@media (max-width: 639px) {
    .results-score-cluster {
        gap: 0.85rem;
    }

    .results-score-ring {
        width: 4.75rem;
        height: 4.75rem;
    }

    .results-progress-value {
        font-size: 1.45rem;
    }

    .results-score-headline {
        font-size: 1.125rem;
    }

    .results-word-pair {
        grid-template-columns: 1fr;
    }

    .results-word-row-flag {
        white-space: normal;
        text-align: right;
    }
}

.results-end {
    margin-top: 2rem;
}

.results-topic-beat {
    margin: 0 0 0.75rem;
}

.results-topic-beat.hidden,
.results-topic-beat[hidden] {
    display: none;
    margin: 0;
}

.results-topic-beat-title {
    margin: 0;
    color: var(--teacher-text);
    font-size: 0.9375rem;
    font-weight: 800;
    line-height: 1.2;
}

.results-topic-beat.is-complete .results-topic-beat-title {
    color: var(--teacher-primary-dark);
}

.results-topic-beat-line {
    margin: 0.25rem 0 0;
    color: var(--teacher-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
}

.results-actions-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.results-action-primary,
.results-action-secondary,
.results-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    max-width: 100%;
    min-height: 48px;
    padding: 0.625rem 0.9rem;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}

.results-action-primary {
    order: -1;
    border: 0;
    background: var(--teacher-text);
    color: var(--teacher-card);
    transition: background-color 150ms ease;
}

.results-action-primary:hover {
    background: color-mix(in srgb, var(--teacher-text) 86%, var(--teacher-card));
}

.results-action-primary:active {
    background: color-mix(in srgb, var(--teacher-text) 78%, var(--teacher-card));
}

.results-action-secondary {
    border: 1px solid var(--teacher-border-strong);
    background: var(--teacher-card);
    color: var(--teacher-text);
    transition: background-color 150ms ease, border-color 150ms ease;
}

.results-action-secondary:hover {
    background: var(--teacher-surface-hover);
}

.results-action-link {
    border: 0;
    background: transparent;
    color: var(--teacher-primary-dark);
    min-height: 2.75rem;
    transition: color 150ms ease;
}

.results-action-link:hover {
    color: var(--teacher-primary);
}

.results-action-link:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}

@media (min-width: 640px) {
    .results-actions-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
        align-items: center;
    }

    .results-action-primary {
        order: 0;
    }
}
.songs-player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 220px;
    background: #0f172a;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    overflow: hidden;
}
.songs-player-poster {
    position: absolute;
    inset: 0;
    z-index: 2;
    background-size: cover;
    background-position: center;
    background-color: #0f172a;
    transition: opacity 0.2s ease;
}
.songs-player-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.songs-player-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 0;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.songs-player-play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff;
    margin-left: 3px;
}
.songs-player-wrap.is-playing .songs-player-poster {
    opacity: 0;
    pointer-events: none;
}
.songs-player-wrap.is-failed .songs-player-poster {
    opacity: 1;
    pointer-events: auto;
}
.songs-player-wrap iframe,
.songs-player-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    background: #000;
}
.songs-player-wrap.is-ready iframe,
.songs-player-wrap.is-ready .songs-player-frame {
    opacity: 1;
}
.songs-player-wrap.is-playing iframe,
.songs-player-wrap.is-playing .songs-player-frame {
    pointer-events: auto;
}
.songs-player-wrap.songs-player-poster-only {
    cursor: default;
}
.songs-player-wrap.songs-player-poster-only .songs-player-play {
    display: none !important;
}
.songs-player-wrap.songs-player-poster-only iframe,
.songs-player-wrap.songs-player-poster-only .songs-player-frame {
    display: none !important;
}
.songs-order-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.songs-order-nav-btn {
    flex-shrink: 0;
}
.songs-order-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 28px;
    max-width: 100%;
}
.songs-order-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 999px;
    border: 1.5px solid #bfdbfe;
    background: #fff;
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.songs-order-dot.is-done {
    background: #dbeafe;
    border-color: #60a5fa;
}
.songs-order-dot.is-current {
    width: 12px;
    height: 12px;
    background: #2563eb;
    border-color: #1d4ed8;
    transform: scale(1.15);
}
.songs-order-dot-ellipsis {
    color: #9ca3af;
    font-size: 12px;
    line-height: 1;
    user-select: none;
}
/* Speak: step counter + mint progress dots in card header */
.songs-speak-steps {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
    max-width: min(12.5rem, 46vw);
    padding-top: 0.125rem;
}
.songs-speak-steps-label {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--teacher-text-secondary, #6b7280);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.songs-speak-dots {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: wrap;
    min-height: 1rem;
    max-width: 100%;
}
.songs-speak-dot {
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    border-radius: 999px;
    border: 1.5px solid rgba(29, 158, 117, 0.35);
    background: var(--teacher-card, #fff);
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.songs-speak-dot.is-done {
    background: var(--teacher-primary-soft, #e1f5ee);
    border-color: var(--teacher-primary, #1d9e75);
}
.songs-speak-dot.is-current {
    width: 0.625rem;
    height: 0.625rem;
    background: var(--teacher-primary, #1d9e75);
    border-color: var(--teacher-primary-dark, #0f6e56);
    transform: scale(1.12);
}
.songs-speak-dot:focus-visible {
    outline: 2px solid var(--teacher-primary, #1d9e75);
    outline-offset: 2px;
}
.songs-speak-dot-ellipsis {
    color: var(--teacher-text-secondary, #6b7280);
    font-size: 0.75rem;
    line-height: 1;
    user-select: none;
}
@media (prefers-reduced-motion: reduce) {
    .songs-speak-dot {
        transition: none;
    }
}
.songs-player-compact {
    max-height: 140px;
}
.songs-speak-waveform {
    min-height: 4rem;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
}
/* Speak: simple feedback (score + one tip) vs advanced disclosure */
.songs-speak-simple {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.songs-speak-simple.hidden {
    display: none;
}
.songs-speak-tip {
    border-radius: 0.875rem;
    background: var(--teacher-surface-muted);
    border: 1px solid var(--teacher-border);
    padding: 0.7rem 0.85rem;
}
.songs-speak-tip.hidden {
    display: none;
}
.songs-speak-tip-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--teacher-text-secondary);
    margin-bottom: 0.2rem;
}
.songs-speak-tip-text {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--teacher-text);
}
.songs-speak-advanced {
    border-radius: 0.875rem;
    border: 1px solid var(--teacher-border);
    background: var(--teacher-card);
    overflow: hidden;
}
.songs-speak-advanced.hidden {
    display: none;
}
.songs-speak-advanced-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    user-select: none;
}
.songs-speak-advanced-summary::-webkit-details-marker {
    display: none;
}
.songs-speak-advanced-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    text-align: left;
}
.songs-speak-advanced-title {
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--teacher-text);
}
.songs-speak-advanced-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--teacher-text-secondary);
}
.songs-speak-advanced-chevron {
    color: var(--teacher-text-secondary);
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}
.songs-speak-advanced[open] .songs-speak-advanced-chevron {
    transform: rotate(180deg);
}
.songs-speak-advanced-summary:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: -2px;
}
.songs-speak-advanced-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--teacher-border);
}
.songs-speak-advanced-panel #songsSpeakListenCoach {
    align-self: flex-start;
    margin-top: 0.65rem;
}
.songs-speak-results {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    margin: 0;
}
.songs-speak-results:empty {
    display: none;
}
.songs-speak-results .songs-speak-word {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--teacher-border);
}
.songs-speak-results .songs-speak-word:last-child {
    border-bottom: 0;
    padding-bottom: 0.15rem;
}
.songs-speak-word-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}
.songs-speak-word-term {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--teacher-text);
    min-width: 0;
}
.songs-speak-word-status {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--teacher-text-secondary);
    text-align: right;
    flex-shrink: 0;
}
.songs-speak-word-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--teacher-text-secondary);
}
.songs-speak-word.is-ok .songs-speak-word-status {
    color: var(--teacher-primary-dark);
}
.songs-speak-word.is-issue .songs-speak-word-status {
    color: #b45309;
}
.songs-speak-word.is-miss .songs-speak-word-status {
    color: #b91c1c;
}
.songs-speak-word-tip {
    margin-top: 0.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.75rem;
    background: var(--teacher-surface-muted);
    font-size: 0.8125rem;
    color: var(--teacher-text);
}
.songs-speak-word-tip-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--teacher-text-secondary);
    margin-bottom: 0.2rem;
}
.songs-speak-word-tip-guide {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--teacher-text);
}
.songs-speak-word-tip-heard {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--teacher-text-secondary);
}
.songs-speak-word-actions {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.songs-speak-word-listen {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2rem;
    padding: 0 0.65rem;
    border-radius: 9999px;
    border: 1px solid var(--teacher-border-strong);
    background: var(--teacher-card);
    color: var(--teacher-text);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.songs-speak-word-listen:hover {
    background: var(--teacher-surface-muted);
}
.songs-speak-word-listen:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}
.songs-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--teacher-border);
    background: var(--teacher-card);
}
.songs-card-locked { opacity: 0.72; }
.songs-card-thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}
.songs-card-body { min-width: 0; flex: 1; }
.songs-card-title { font-weight: 700; font-size: 14px; color: var(--teacher-text); }
.songs-card-artist { font-size: 12px; color: var(--teacher-text-secondary); }
.songs-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.songs-chip {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--teacher-surface-muted);
    color: var(--teacher-text-secondary);
}
.songs-badge-free { font-size: 10px; font-weight: 700; color: var(--teacher-primary-dark); }
.songs-badge-pro { font-size: 10px; font-weight: 700; color: #b45309; }
.songs-card-btn {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--teacher-border-strong);
    background: var(--teacher-surface-muted);
    color: var(--teacher-text);
}
.songs-card-btn:hover {
    background: var(--teacher-surface-hover);
}
.songs-card-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.songs-card-btn-danger {
    border-color: rgba(248, 113, 113, 0.45);
    color: #f87171;
    background: transparent;
}
.songs-card-btn-danger:hover {
    background: rgba(239, 68, 68, 0.12);
}
.songs-skeleton {
    height: 88px;
    border-radius: 16px;
    background: linear-gradient(90deg, #f3f4f6, #e5e7eb, #f3f4f6);
    animation: songs-shimmer 1.2s infinite;
}
.songs-search-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
}
.songs-spinner-sm {
    width: 22px;
    height: 22px;
    border-width: 2px;
}
.songs-chip-karaoke {
    background: #ecfdf5;
    color: #047857;
}
@keyframes songs-shimmer {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}
.songs-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}
.songs-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    transition: width 0.3s ease;
}
.songs-offset-btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.songs-mode-card {
    text-align: left;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.songs-mode-card:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}
.songs-mode-card-entry {
    width: 100%;
    padding: 18px 16px;
    gap: 6px;
}
.songs-mode-card-entry .songs-mode-card-title {
    font-size: 17px;
}
.songs-mode-card-entry .songs-mode-card-sub {
    font-size: 13px;
}
.songs-mode-card-secondary {
    padding: 12px 14px;
}
.songs-mode-card-secondary .songs-mode-card-title {
    font-size: 14px;
    font-weight: 600;
}
.songs-mode-card-default {
    border-color: #bfdbfe;
    background: #f8fbff;
}
.songs-mode-card-title {
    font-weight: 700;
    font-size: 15px;
    color: #111827;
}
.songs-mode-card-sub {
    font-weight: 500;
    font-size: 12px;
    color: #6b7280;
}
.songs-mode-card-accent {
    border-color: #60a5fa;
    background: linear-gradient(180deg, #eff6ff 0%, #fff 70%);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
.songs-mode-card-accent:hover {
    border-color: #3b82f6;
    background: linear-gradient(180deg, #dbeafe 0%, #fff 75%);
}
.songs-hub-entry {
    margin-top: 1.5rem;
}
.songs-hub-more-label {
    margin: 1.25rem 0 0.5rem;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #6b7280;
}
.songs-hub-modes {
    margin-top: 0;
}
.songs-hub-tools {
    margin-top: 1.25rem;
    border-top: 1px solid #f3f4f6;
    padding-top: 0.75rem;
}
.songs-hub-tools > summary {
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    padding: 4px 0;
    user-select: none;
}
.songs-hub-tools > summary::-webkit-details-marker {
    display: none;
}
.songs-hub-tools > summary::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 8px;
    border-left: 5px solid #9ca3af;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    vertical-align: middle;
    transition: transform 0.15s ease;
}
.songs-hub-tools[open] > summary::before {
    transform: rotate(90deg);
}
.songs-hub-tools[open] > summary {
    color: #4b5563;
}
.songs-hub-tools-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0 2px;
}
.songs-hub-offset {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}
.songs-hub-tools-hint {
    font-size: 13px;
    color: #6b7280;
}
.songs-hub-offset-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.songs-hub-offset-value {
    font-weight: 600;
    color: #1f2937;
    min-width: 2.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.songs-hub-remove {
    align-self: flex-start;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    background: transparent;
    border: none;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.songs-hub-remove:hover {
    color: #6b7280;
}
.songs-hub-remove:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
    border-radius: 4px;
}
.songs-hub-rings {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.songs-hub-ring {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
}
.songs-hub-ring.is-entry {
    background: #eff6ff;
    color: #1d4ed8;
}
.songs-hub-ring.is-done {
    background: #ecfdf5;
    color: #047857;
}
.songs-ad-banner {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 10px 14px;
}
.songs-lyrics-panel {
    max-height: 320px;
    overflow-y: auto;
    padding: 16px;
    border-radius: 16px;
    background: #0f172a;
    color: #e2e8f0;
    text-align: center;
}
.songs-lyric-line { opacity: 0.45; padding: 6px 0; font-size: 15px; cursor: pointer; }
.songs-lyric-line-near { opacity: 0.7; padding: 6px 0; font-size: 17px; cursor: pointer; }
.songs-lyric-line-active {
    opacity: 1;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    padding: 8px 0;
    cursor: pointer;
}
.songs-lyric-line-en {
    line-height: 1.25;
}
.songs-lyric-line-tr {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    color: #93c5fd;
    opacity: 0.95;
}
.songs-lyric-line-tr.is-pending {
    font-style: italic;
    opacity: 0.7;
}
.songs-lyric-line-tr.is-failed {
    font-style: italic;
    opacity: 0.75;
    color: #bfdbfe;
}
.songs-lyric-line-intro {
    opacity: 0.8;
    font-style: italic;
    color: #93c5fd;
}
.songs-lyric-word-active {
    text-decoration: underline;
    text-decoration-color: #93c5fd;
}
.songs-match-card {
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(37, 99, 235, 0.06), transparent 55%),
        radial-gradient(100% 70% at 100% 0%, rgba(14, 165, 233, 0.05), transparent 50%),
        #fff;
}
.songs-match-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.songs-match-score {
    font-size: 13px;
    font-weight: 700;
    color: #1d4ed8;
    font-variant-numeric: tabular-nums;
}
.songs-match-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    align-items: start;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}
.songs-match-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}
.songs-match-col:first-child {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}
.songs-match-col:last-child {
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.1);
}
.songs-match-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 2px;
}
.songs-match-chip {
    display: block;
    width: 100%;
    margin-bottom: 0;
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    text-align: left;
    font-weight: 600;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.songs-match-chip:not(:disabled):hover {
    border-color: #93c5fd;
    background: #f8fbff;
}
.songs-match-chip:not(:disabled):active {
    transform: scale(0.98);
}
.songs-match-chip:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.songs-match-chip.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
}
.songs-match-chip.is-targetable {
    border-color: #7dd3fc;
    background: #f0f9ff;
}
.songs-match-chip.is-done {
    opacity: 0.55;
    text-decoration: line-through;
    pointer-events: none;
    border-color: #bbf7d0;
    background: #ecfdf5;
    color: #065f46;
    box-shadow: none;
}
.songs-match-loading,
.songs-match-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 28px 12px;
}
.songs-match-loading .songs-spinner {
    margin-bottom: 12px;
}
@media (max-width: 420px) {
    .songs-match-board { gap: 10px 10px; padding: 10px; }
    .songs-match-col { padding: 8px; }
    .songs-match-chip { padding: 11px 12px; font-size: 14px; }
}
.songs-btn.is-on {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
}
.songs-order-chip, .songs-order-token {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    font-weight: 600;
}
.songs-card-progress {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
}
.songs-card-status {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
}
.songs-card-status-blocked {
    background: #f3f4f6;
    color: #6b7280;
}
.songs-shake { animation: songs-shake 0.35s; }
@keyframes songs-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.songs-import-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}
.songs-import-overlay.hidden {
    display: none !important;
}
.songs-import-box {
    background: #fff;
    padding: 24px 32px;
    border-radius: 16px;
    text-align: center;
}
.songs-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: songs-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes songs-spin { to { transform: rotate(360deg); } }

.songs-page {
    padding-bottom: 4.5rem;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (min-width: 640px) {
    .songs-page {
        padding-bottom: 1.5rem;
    }
}
.songs-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1d4ed8;
}
.songs-success-text { color: #047857; }
.songs-exercise-card {
    margin-bottom: 1.25rem;
}
.songs-line-card {
    border-radius: 16px;
    background: #0f172a;
    color: #fff;
    padding: 1.25rem 1rem;
    text-align: center;
}
.songs-line-card-tr {
    color: #bfdbfe;
}
.songs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding-bottom: 0.25rem;
}
.songs-listen-panel {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid #f3f4f6;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
    padding: 1rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
@media (min-width: 640px) {
    .songs-listen-panel {
        padding: 1.15rem 1.25rem 1.25rem;
    }
}
.songs-actions-speak,
.songs-actions-listen {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
}
/* Speak: primary → listen → demoted nav. .songs-btn { display } must not beat .hidden */
.songs-actions-speak {
    gap: 10px;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}
.songs-actions-speak .songs-btn.hidden,
.songs-actions-speak .songs-btn[hidden] {
    display: none !important;
}
/* Belt-and-suspenders: mode attribute owns which primary CTA exists */
.songs-actions-speak[data-speak-mode="idle"] #songsSpeakRetry,
.songs-actions-speak[data-speak-mode="idle"] #songsSpeakContinue,
.songs-actions-speak[data-speak-mode="recording"] #songsSpeakRetry,
.songs-actions-speak[data-speak-mode="recording"] #songsSpeakContinue,
.songs-actions-speak[data-speak-mode="busy"] #songsSpeakRecordBtn,
.songs-actions-speak[data-speak-mode="busy"] #songsSpeakRetry,
.songs-actions-speak[data-speak-mode="busy"] #songsSpeakContinue,
.songs-actions-speak[data-speak-mode="fail"] #songsSpeakRecordBtn,
.songs-actions-speak[data-speak-mode="fail"] #songsSpeakContinue,
.songs-actions-speak[data-speak-mode="pass"] #songsSpeakRecordBtn {
    display: none !important;
}
.songs-actions-speak .songs-action-primary-row {
    order: 1;
    flex-direction: column;
    width: 100%;
    margin: 0;
    gap: 8px;
}
.songs-actions-speak .songs-action-listen {
    order: 2;
    display: flex;
    width: 100%;
    margin: 0;
    justify-content: center;
}
.songs-actions-speak .songs-action-nav {
    order: 3;
}
.songs-actions-speak[data-speak-mode="idle"] #songsSpeakRecordBtn,
.songs-actions-speak[data-speak-mode="recording"] #songsSpeakRecordBtn,
.songs-actions-speak[data-speak-mode="fail"] #songsSpeakRetry,
.songs-actions-speak[data-speak-mode="pass"] #songsSpeakContinue {
    width: 100%;
}
.songs-actions-speak[data-speak-mode="pass"] #songsSpeakRetry {
    width: 100%;
    order: 2;
    min-height: 2.5rem;
    font-size: 0.8125rem;
}
.songs-actions-speak[data-speak-mode="pass"] #songsSpeakContinue {
    order: 1;
}
.songs-actions-speak .songs-speak-listen-btn {
    width: auto;
    min-width: min(100%, 14rem);
    max-width: 100%;
}
.songs-actions-speak[data-speak-mode="pass"] .songs-speak-listen-btn,
.songs-actions-speak[data-speak-mode="fail"] .songs-speak-listen-btn {
    width: 100%;
    min-width: 0;
}
.songs-actions-speak .songs-speak-nav {
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding-top: 0.15rem;
    gap: 8px;
}
.songs-actions-speak .songs-speak-nav-btn {
    min-height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--teacher-text-secondary);
}
.songs-actions-speak .songs-speak-nav-btn:hover:not(:disabled) {
    color: var(--teacher-text);
}
@media (max-width: 379px) {
    .songs-actions-speak .songs-speak-nav-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .songs-actions-speak .songs-speak-nav-btn {
        min-width: 2.75rem;
        padding: 0 0.65rem;
    }
}
#songsViewSpeak .songs-btn-primary {
    background: var(--teacher-primary);
    color: #fff;
    border-color: var(--teacher-primary);
}
#songsViewSpeak .songs-btn-primary:hover:not(:disabled) {
    background: var(--teacher-primary-dark);
    border-color: var(--teacher-primary-dark);
}
#songsViewSpeak .songs-btn-hero {
    box-shadow: 0 1px 2px rgba(15, 110, 86, 0.28);
}
#songsViewSpeak .songs-btn-hero:hover:not(:disabled) {
    box-shadow: 0 2px 8px rgba(15, 110, 86, 0.32);
}
#songsViewSpeak .songs-btn:focus-visible {
    outline: 2px solid var(--teacher-primary);
    outline-offset: 2px;
}
#songsViewSpeak .songs-speak-wave-wrap {
    background: linear-gradient(165deg, var(--teacher-primary-dark) 0%, #0a5c47 100%);
}
#songsViewSpeak .songs-feedback-banner.is-info {
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
    border: 1px solid rgba(29, 158, 117, 0.28);
}
.songs-listen-chrome {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 0.65rem 0.75rem 0.7rem;
    border-radius: 1rem;
    border: 1px solid var(--teacher-border);
    background: var(--teacher-surface-muted);
}
.songs-action-nav,
.songs-action-listen,
.songs-action-transport,
.songs-action-tools,
.songs-action-primary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}
.songs-action-nav {
    justify-content: space-between;
    gap: 10px;
}
.songs-action-listen {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    align-items: center;
    justify-content: center;
}
.songs-action-primary-row {
    flex-direction: column;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}
/* Listen mode (and non-Speak) heroes stay full-width; Speak modes set width via data-speak-mode */
.songs-actions-listen .songs-action-primary-row .songs-btn-hero,
.songs-actions-listen .songs-action-primary-row .songs-btn-secondary {
    width: 100%;
}
.songs-action-transport {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "prev play next";
    gap: 8px;
    width: 100%;
    align-items: center;
}
.songs-action-transport #songsListenPrev { grid-area: prev; justify-self: start; }
.songs-action-transport #songsListenPlay { grid-area: play; min-width: 7.5rem; }
.songs-action-transport #songsListenNext { grid-area: next; justify-self: end; }
.songs-action-tools {
    gap: 6px;
    margin-top: 0.4rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--teacher-border);
    justify-content: center;
}
.songs-btn-tool {
    min-height: 2.25rem;
    padding: 0 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--teacher-text-secondary);
}
.songs-btn-tool.is-on {
    background: var(--teacher-card);
    color: var(--teacher-text);
    border-color: var(--teacher-border-strong);
}
.songs-btn-coach {
    color: var(--teacher-text-secondary);
}
.songs-actions-match {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
}
.songs-actions-match #songsMatchNext {
    width: 100%;
}
@media (min-width: 640px) {
    .songs-listen-chrome {
        padding: 0.75rem 0.9rem 0.8rem;
    }
    .songs-action-transport {
        grid-template-columns: auto auto auto;
        grid-template-areas: "prev play next";
        justify-content: center;
    }
    .songs-action-transport #songsListenPrev,
    .songs-action-transport #songsListenPlay,
    .songs-action-transport #songsListenNext {
        justify-self: center;
    }
}
.songs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.songs-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.songs-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.songs-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.songs-btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}
.songs-btn-hero {
    min-height: 48px;
    padding: 0 22px;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}
.songs-btn-hero:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}
.songs-btn-compact {
    min-height: 40px;
    padding: 0 14px;
    font-size: 13px;
}
.songs-btn-ghost {
    background: transparent;
    color: var(--teacher-text-secondary);
    border-color: transparent;
}
.songs-btn-ghost:hover:not(:disabled) {
    background: var(--teacher-surface-muted);
    color: var(--teacher-text);
}
.songs-btn-record {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.songs-btn-record:hover:not(:disabled) {
    background: #b91c1c;
}
.songs-btn-success {
    background: #059669;
    color: #fff;
    border-color: #059669;
}
.songs-btn-secondary {
    background: var(--teacher-card);
    color: var(--teacher-text);
    border-color: var(--teacher-border-strong);
}
.songs-btn-secondary:hover:not(:disabled) {
    background: var(--teacher-surface-muted);
    border-color: var(--teacher-border-strong);
}
.songs-speak-wave-wrap {
    border-radius: 16px;
    background: linear-gradient(165deg, #1d4ed8 0%, #1e40af 100%);
    padding: 12px 12px 14px;
    color: #fff;
}
.songs-speak-wave-wrap.hidden {
    display: none;
}
.songs-speak-wave-label {
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}
.songs-rec-dot {
    color: #fecaca;
    font-size: 10px;
    margin-right: 6px;
    animation: songs-pulse 1s ease-in-out infinite;
}
@keyframes songs-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
.songs-speak-waveform {
    min-height: 56px;
    border-radius: 12px;
    background: transparent;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.songs-wave-bar {
    background-color: rgba(255, 255, 255, 0.95);
    width: 4px;
    min-height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: center;
}
.songs-feedback-banner {
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}
.songs-feedback-banner.hidden {
    display: none;
}
.songs-feedback-banner.is-success {
    background: var(--teacher-primary-soft);
    color: var(--teacher-primary-dark);
    border: 1px solid rgba(29, 158, 117, 0.28);
}
.songs-feedback-banner.is-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.songs-feedback-banner.is-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.songs-order-built {
    min-height: 3.25rem;
    border: 1px dashed #93c5fd;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #eff6ff;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.songs-order-built.is-correct {
    background: #ecfdf5;
    border-color: #34d399;
    border-style: solid;
}
.songs-order-built.is-wrong {
    background: #fef2f2;
    border-color: #f87171;
    border-style: solid;
}
.songs-order-built.is-correct .songs-order-token {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}
.songs-order-built.is-wrong .songs-order-token {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}
.songs-match-chip.is-wrong {
    border-color: #ef4444;
    background: #fef2f2;
}
.songs-fill-timer {
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}
.songs-fill-timer.is-urgent .songs-fill-timer-bar {
    background: linear-gradient(90deg, #ea580c, #dc2626);
}
.songs-fill-timer.is-frozen .songs-fill-timer-bar {
    background: #94a3b8;
}
.songs-fill-timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    transition: width 80ms linear;
}
.songs-fill-context {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 168px;
    overflow: hidden;
    padding: 10px 12px;
    border-radius: 14px;
    background: #0f172a;
    color: #94a3b8;
    text-align: center;
}
.songs-fill-ctx-line {
    font-size: 13px;
    line-height: 1.35;
    opacity: 0.45;
    transition: opacity 0.15s ease, font-size 0.15s ease, color 0.15s ease;
}
.songs-fill-ctx-line.is-near {
    opacity: 0.75;
    font-size: 14px;
    color: #cbd5e1;
}
.songs-fill-ctx-line.is-active {
    opacity: 1;
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
}
.songs-fill-sentence {
    border-radius: 16px;
    background: #0f172a;
    color: #fff;
    padding: 1.25rem 1rem;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.7;
    min-height: 4.5rem;
}
.songs-fill-sentence.is-correct {
    box-shadow: inset 0 0 0 2px #34d399;
}
.songs-fill-sentence.is-wrong {
    box-shadow: inset 0 0 0 2px #f87171;
}
.songs-fill-sentence.is-frozen {
    box-shadow: inset 0 0 0 2px #94a3b8;
    opacity: 0.92;
}
.songs-fill-word {
    display: inline;
}
.songs-fill-blank {
    display: inline-block;
    min-width: 4.5rem;
    margin: 0 2px;
    padding: 2px 8px;
    border-radius: 8px;
    border-bottom: 2px dashed #93c5fd;
    color: #bfdbfe;
    letter-spacing: 0.08em;
}
.songs-fill-blank.is-active {
    border-bottom-color: #fff;
    color: #fff;
}
.songs-fill-blank.is-filled {
    border-bottom-style: solid;
    color: #fff;
}
.songs-fill-blank.is-correct {
    background: #065f46;
    border-bottom-color: #6ee7b7;
    color: #d1fae5;
}
.songs-fill-blank.is-wrong {
    background: #7f1d1d;
    border-bottom-color: #fca5a5;
    color: #fee2e2;
}
.songs-fill-chip {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    font-weight: 700;
    min-height: 44px;
}
.songs-fill-chip:disabled {
    opacity: 0.45;
}

/* Welcome type — Cláudia template: Bricolage (título) + DM Sans (corpo) */
@font-face {
  font-family: "Welcome Titulo";
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/bricolage-grotesque:vf@5.2.8/latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Welcome Corpo";
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/dm-sans@5.2.6/latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Welcome Corpo";
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/dm-sans@5.2.6/latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Welcome Corpo";
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/dm-sans@5.2.6/latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Welcome landing — layout + polish */
/* display:flex must not beat Tailwind .hidden (same specificity; this file loads later) */
.welcome-page {
  --welcome-gap-section: 3.25rem;
  --welcome-gap-tight: 0.75rem;
  --welcome-blue: #2563eb;
  --welcome-blue-deep: #1d4ed8;
}

.welcome-page.hidden {
  display: none !important;
}

.welcome-page:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: var(--welcome-gap-section);
  padding-bottom: 1rem;
}

.welcome-page--lean {
  gap: 0;
  min-height: calc(100vh - 7rem);
  justify-content: center;
  padding-bottom: 0.5rem;
}

.welcome-offer-line {
  margin-top: 1rem;
  max-width: 28rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #374151;
}

.welcome-footer-credit {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.welcome-page ::selection {
  background: #bfdbfe;
  color: #1e3a8a;
}

.welcome-section,
.welcome-final {
  scroll-margin-top: 1.25rem;
}

.welcome-hero {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.welcome-hero-copy,
.welcome-hero-scene,
.welcome-hero-actions {
  min-width: 0;
}

.welcome-hero-title {
  font-family: "Welcome Titulo", "Segoe UI", sans-serif;
  font-size: clamp(1.8rem, 3.4vw, 2.15rem);
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: 1.12;
  letter-spacing: -0.021em;
  color: #111827;
  max-width: 16ch;
  text-wrap: balance;
}

.welcome-hero-lead {
  font-family: "Welcome Corpo", "Segoe UI", sans-serif;
  margin-top: 0.75rem;
  font-size: 0.97rem;
  font-weight: 400;
  line-height: 1.45;
  color: #3f4754;
  max-width: 28ch;
  text-wrap: pretty;
}

.welcome-hero-actions-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  max-width: 28rem;
}

@media (min-width: 480px) {
  .welcome-hero-actions-row {
    grid-template-columns: 1fr 1fr;
  }
}

.welcome-hero-more {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  border-radius: 0.5rem;
  text-underline-offset: 0.18em;
}

.welcome-hero-more i {
  font-size: 0.7rem;
}

.welcome-hero-more:hover {
  color: #111827;
}

.welcome-hero-more:focus {
  outline: none;
}

.welcome-hero-more:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
}

.welcome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.25rem;
  border-radius: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 120ms ease;
}

.welcome-btn:focus {
  outline: none;
}

.welcome-btn:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
}

.welcome-btn:active {
  transform: translateY(1px);
}

.welcome-btn-primary {
  background: var(--welcome-blue);
  color: #fff;
  border: 1px solid var(--welcome-blue);
}

.welcome-btn-primary:hover {
  background: var(--welcome-blue-deep);
  border-color: var(--welcome-blue-deep);
}

.welcome-btn-secondary {
  background: #eff6ff;
  color: var(--welcome-blue-deep);
  border: 1px solid #dbeafe;
}

.welcome-btn-secondary:hover {
  background: #dbeafe;
}

.welcome-btn-on-dark {
  background: #fff;
  color: var(--welcome-blue-deep);
  border: 1px solid #fff;
}

.welcome-btn-on-dark:hover {
  background: #eff6ff;
}

.welcome-btn-on-dark:focus-visible,
.welcome-btn-ghost-on-dark:focus-visible {
  box-shadow: 0 0 0 2px var(--welcome-blue-deep), 0 0 0 4px #fff;
}

.welcome-btn-ghost-on-dark {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.welcome-btn-ghost-on-dark:hover {
  background: rgba(255, 255, 255, 0.12);
}

.welcome-page--lean .welcome-hero-actions {
  max-width: 20rem;
}

.welcome-btn-go {
  font-family: "Welcome Corpo", "Segoe UI", sans-serif;
  width: 100%;
  min-height: 3.4rem;
  border: 0;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.welcome-btn-go:hover {
  background: #1f2937;
}

.welcome-btn-trial {
  font-family: "Welcome Corpo", "Segoe UI", sans-serif;
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.5rem;
  border: 1px solid var(--teacher-border-strong, rgba(0, 0, 0, 0.10));
  border-radius: 999px;
  background: var(--teacher-card, #fff);
  color: var(--teacher-text, #1a1a1a);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.welcome-btn-trial:hover {
  background: var(--teacher-surface-hover, #ececf1);
}

.welcome-btn-trial:focus {
  outline: none;
}

.welcome-btn-trial:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--teacher-primary, #1d9e75);
}

.welcome-btn-trial[hidden] {
  display: none;
}

.guest-trial-sheet {
  background: var(--teacher-card, #fff);
  color: var(--teacher-text, #1a1a1a);
}

.guest-trial-phrase-card {
  border: 1px solid var(--teacher-border, rgba(0, 0, 0, 0.08));
  border-radius: 1rem;
  padding: 1rem 1.125rem;
  background: var(--teacher-primary-soft, #e1f5ee);
}

.guest-trial-record-btn.is-recording {
  background: var(--teacher-primary, #1d9e75);
}

.guest-trial-record-btn.is-recording:hover {
  background: var(--teacher-primary-dark, #0f6e56);
}

.guest-trial-score-row {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}

.guest-trial-score {
  flex: 0 0 auto;
  min-width: 4.5rem;
  border-radius: 1rem;
  border: 1px solid var(--teacher-border, rgba(0, 0, 0, 0.08));
  background: var(--teacher-card, #fff);
  padding: 0.75rem;
  text-align: center;
}

.guest-trial-score-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--teacher-primary-dark, #0f6e56);
  font-variant-numeric: tabular-nums;
}

.guest-trial-score-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teacher-text-secondary, #6b7280);
}

.guest-trial-tip {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 1rem;
  border: 1px solid var(--teacher-border, rgba(0, 0, 0, 0.08));
  background: var(--teacher-surface-muted, #f5f5f7);
  padding: 0.75rem 0.875rem;
}

.guest-trial-tip-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teacher-text-secondary, #6b7280);
}

.guest-trial-tip-text {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--teacher-text, #1a1a1a);
}

.welcome-login-line {
  font-family: "Welcome Corpo", "Segoe UI", sans-serif;
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #4b5563;
}

.welcome-login-link {
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  color: #374151;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.welcome-login-link:hover {
  color: #111827;
}

.welcome-login-link:focus {
  outline: none;
}

.welcome-login-link:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
  border-radius: 0.25rem;
}

.welcome-page--lean .welcome-offer-line {
  font-family: "Welcome Corpo", "Segoe UI", sans-serif;
  text-align: center;
  font-size: 0.8125rem;
  color: #374151;
}

/* Mobile: promessa → cena → CTA. Desktop: copy+CTA | cena */
@media (min-width: 1024px) {
  .welcome-hero {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    grid-template-rows: auto 1fr;
    gap: 1.25rem 2.75rem;
    align-items: start;
  }

  .welcome-hero-copy {
    grid-column: 1;
    grid-row: 1;
  }

  .welcome-hero-actions {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    padding-bottom: 0.25rem;
  }

  .welcome-hero-scene {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: stretch;
  }

  .welcome-hero-scene .welcome-scene {
    height: 100%;
    min-height: 26rem;
  }
}

/* Início reduzido — coluna central, no ritmo da Cláudia */
.welcome-page--lean .welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(100%, 22rem);
  margin: 0 auto;
  gap: 0;
  min-height: calc(100vh - 8rem);
  justify-content: space-between;
}

@media (min-width: 1024px) {
  .welcome-page--lean .welcome-hero {
    width: min(100%, 30rem);
    min-height: calc(100vh - 6.5rem);
  }

  .welcome-page--lean .welcome-step.is-active {
    padding: 1.5rem 1.5rem 1.65rem;
  }

  .welcome-page--lean .welcome-intro-mark {
    min-height: 12rem;
    max-width: 22rem;
  }

  .welcome-page--lean .welcome-intro-art {
    height: 11.5rem;
  }

  .welcome-page--lean .welcome-hero-title {
    font-size: clamp(2rem, 2.5vw, 2.45rem);
    max-width: 18ch;
  }

  .welcome-page--lean .welcome-hero-lead {
    font-size: 1.05rem;
    max-width: 32ch;
  }

  .welcome-page--lean .welcome-offer-line,
  .welcome-page--lean .welcome-legal-line {
    font-size: 0.875rem;
  }

  .auth-modal-card {
    max-width: 28rem;
  }
}

.welcome-step-panels {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.welcome-step[hidden] {
  display: none !important;
}

.welcome-step.is-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 1.2rem 1.15rem 1.4rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background:
    radial-gradient(ellipse 85% 65% at 50% 0%, rgba(56, 189, 248, 0.16), transparent 58%),
    linear-gradient(165deg, rgba(15, 52, 68, 0.82) 0%, rgba(12, 74, 62, 0.78) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  animation: welcome-step-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.welcome-page--lean .welcome-step.is-active .welcome-hero-title {
  color: #f8fafc;
}

.welcome-page--lean .welcome-step.is-active .welcome-hero-lead {
  color: #cbd5e1;
}

@keyframes welcome-step-in {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-step.is-active {
    animation: none;
  }

  .welcome-step-dot {
    transition: none;
  }

  .welcome-step-dot.is-active {
    transform: none;
  }
}

.welcome-intro-mark {
  width: 100%;
  max-width: 18rem;
  min-height: 9.5rem;
  margin-bottom: 1rem;
  display: grid;
  place-items: end center;
  background: transparent;
}

.welcome-page--lean .welcome-step.is-active .welcome-intro-mark {
  max-width: none;
}

.welcome-intro-art {
  width: auto;
  height: 9rem;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 10px 16px rgba(15, 23, 42, 0.12));
}

.welcome-page--lean .welcome-scene,
.welcome-scene--compact {
  display: block;
  width: 100%;
  min-height: 0;
  grid-template-columns: 1fr;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: left;
}

.welcome-page--lean .welcome-scene-demo {
  margin: 0;
  text-align: left;
  padding: 0.95rem 1rem 1.05rem;
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.welcome-page--lean .welcome-hero-title,
.welcome-page--lean .welcome-hero-lead {
  margin-left: auto;
  margin-right: auto;
}

.welcome-page--lean .welcome-hero-actions {
  width: 100%;
  max-width: none;
  margin-top: auto;
  padding-top: 1.5rem;
  padding-bottom: 0.25rem;
}

.welcome-step-dots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  width: 100%;
  max-width: 11rem;
  margin: 0 auto 1rem;
}

.welcome-step-dot {
  position: relative;
  height: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #bfdbfe;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

/* Larger hit target without thickening the visible bar */
.welcome-step-dot::before {
  content: "";
  position: absolute;
  inset: -0.55rem 0;
}

.welcome-step-dot.is-active {
  background: var(--welcome-blue);
  transform: scaleY(1.15);
}

.welcome-step-dot.is-done {
  background: #60a5fa;
}

.welcome-step-dot:focus {
  outline: none;
}

.welcome-step-dot:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
}

.welcome-step-dot:hover:not(.is-active) {
  background: #93c5fd;
}

.welcome-page--lean .welcome-btn-go {
  gap: 0.55rem;
  background: var(--welcome-blue);
}

.welcome-page--lean .welcome-btn-go:hover {
  background: var(--welcome-blue-deep);
}

.welcome-legal-line {
  margin-top: 1.15rem;
  text-align: center;
  font-family: "Welcome Corpo", "Segoe UI", sans-serif;
  font-size: 0.8125rem;
  color: #475569;
}

.welcome-legal-line[hidden],
.welcome-offer-line[hidden] {
  display: none !important;
}

.welcome-legal-link {
  color: #334155;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.welcome-legal-link:hover {
  color: #0f172a;
}

.auth-reset-saved-btn {
  color: #64748b;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  background: transparent;
  border: 0;
  padding: 0.25rem 0.35rem;
  border-radius: 0.375rem;
  cursor: pointer;
}

.auth-reset-saved-btn:hover {
  color: #334155;
}

.auth-reset-saved-btn:focus {
  outline: none;
}

.auth-reset-saved-btn:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
}

.not-found-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 7rem);
  padding: 1.5rem 1rem 2rem;
}

.not-found-page.hidden {
  display: none !important;
}

.not-found-card {
  width: min(100%, 26rem);
  text-align: center;
  padding: 1.75rem 1.5rem;
  border-radius: 1.25rem;
  border: 1px solid var(--teacher-border, rgba(0, 0, 0, 0.08));
  background: var(--teacher-card, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.not-found-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--teacher-text, #1a1a1a);
}

.not-found-lead {
  margin: 0.65rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--teacher-text-secondary, #6b7280);
}

.not-found-home-link {
  margin-top: 1.35rem;
  width: 100%;
  text-decoration: none;
}

.welcome-scene {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(6.5rem, 34%);
  column-gap: 0.35rem;
  align-items: stretch;
  min-height: 0;
  border-radius: 1.5rem;
  border: 1px solid #e5e7eb;
  background:
    radial-gradient(ellipse 80% 60% at 78% 18%, rgba(59, 130, 246, 0.12), transparent 55%),
    linear-gradient(165deg, #f8fafc 0%, #eff6ff 48%, #e2e8f0 100%);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.welcome-scene-art {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  justify-self: end;
  display: block;
  width: 100%;
  height: auto;
  max-height: 18rem;
  object-fit: contain;
  object-position: bottom right;
  pointer-events: none;
  user-select: none;
}

.welcome-scene-demo {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  position: relative;
  z-index: 1;
  margin: 1rem;
  min-width: 0;
  max-width: none;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: 1.15rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.welcome-scene-situation {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #475569;
}

.welcome-scene-phrase {
  margin-top: 0.65rem;
  font-size: 1.05rem;
  line-height: 1.55;
  font-weight: 600;
}

/* Landing demo only — darker than app result colors so WCAG AA holds on white */
.welcome-scene-phrase .word-score-100,
.welcome-scene-phrase .word-score-90,
.welcome-scene-phrase .word-score-80 {
  color: #047857;
}

.welcome-scene-phrase .word-score-70,
.welcome-scene-phrase .word-score-60 {
  color: #0f766e;
}

.welcome-scene-phrase .word-score-50,
.welcome-scene-phrase .word-score-40 {
  color: #c2410c;
}

.welcome-scene-phrase .word-score-30,
.welcome-scene-phrase .word-score-20,
.welcome-scene-phrase .word-score-10,
.welcome-scene-phrase .word-score-0 {
  color: #b91c1c;
}

.welcome-scene-phrase .word-score-40 {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.welcome-scene-meta {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-top: 0.9rem;
}

.welcome-scene-score {
  flex: 0 0 auto;
  min-width: 3.5rem;
  text-align: center;
  padding: 0.35rem 0.5rem;
  border-radius: 0.85rem;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.welcome-scene-score-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  color: #2563eb;
  font-variant-numeric: tabular-nums;
}

.welcome-scene-score-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.welcome-scene-tip {
  min-width: 0;
  flex: 1;
}

.welcome-scene-tip-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #334155;
}

.welcome-scene-tip-text {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #475569;
}

.welcome-scene-music {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
}

.welcome-scene-music i {
  color: #2563eb;
  font-size: 0.7rem;
}

.welcome-section {
  padding: 0;
}

.welcome-section-title {
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.welcome-section-lead {
  margin-top: 0.55rem;
  max-width: 40rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #4b5563;
}

.welcome-modes,
.welcome-steps {
  list-style: none;
  margin: 1.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .welcome-modes,
  .welcome-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

.welcome-mode {
  padding: 0;
  border: 0;
  background: transparent;
}

.welcome-mode-title,
.welcome-step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.welcome-mode-copy,
.welcome-step-copy {
  margin-top: 0.3rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #4b5563;
}

.welcome-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.welcome-step-index {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 0.75rem;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.welcome-plans-grid {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .welcome-plans-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

.welcome-plan {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: 1.25rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.welcome-plan-pro {
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
}

.welcome-plan-name {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.welcome-plan-price {
  margin-top: 0.45rem;
  font-size: 1.45rem;
  font-weight: 800;
  color: #111827;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.welcome-plan-from {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.welcome-plan-period {
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
}

.welcome-plan-copy {
  margin-top: 0.65rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #4b5563;
  flex: 1;
}

.welcome-plan-cta {
  margin-top: 1.15rem;
  width: 100%;
}

.welcome-faq-list {
  margin-top: 1.15rem;
}

.welcome-faq-item {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.15rem 0;
}

.welcome-faq-item:last-child {
  border-bottom: 0;
}

.welcome-faq-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

.welcome-faq-summary::-webkit-details-marker {
  display: none;
}

.welcome-faq-summary:focus {
  outline: none;
}

.welcome-faq-summary:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
}

.welcome-faq-chevron {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: #64748b;
  transition: transform 160ms ease;
}

.welcome-faq-item[open] .welcome-faq-chevron {
  transform: rotate(180deg);
}

.welcome-faq-answer {
  padding: 0 0.25rem 0.95rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #4b5563;
}

.welcome-final {
  border-radius: 1.5rem;
  border: 1px solid #1d4ed8;
  background: #1d4ed8;
  color: #fff;
  padding: 1.5rem 1.35rem;
}

@media (min-width: 640px) {
  .welcome-final {
    padding: 2rem 2.25rem;
  }
}

.welcome-final-inner {
  display: grid;
  gap: 1.25rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .welcome-final-inner {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.85fr);
    gap: 2rem;
  }
}

.welcome-final-title {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}

.welcome-final-lead {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #dbeafe;
}

.welcome-final-actions {
  display: grid;
  gap: 0.75rem;
}

.welcome-final-credit {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #bfdbfe;
}

@media (min-width: 1024px) {
  .welcome-scene {
    min-height: 26rem;
    grid-template-columns: minmax(0, 1fr) minmax(9rem, 38%);
  }

  .welcome-scene-art {
    max-height: 24rem;
  }

  .welcome-scene-demo {
    margin: 1.25rem;
  }
}

/* Narrow phones: stack art above demo — never overlap */
@media (max-width: 479px) {
  .welcome-scene {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .welcome-scene-art {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    max-height: 9.5rem;
    margin-top: 0.75rem;
  }

  .welcome-scene-demo {
    grid-column: 1;
    grid-row: 2;
    margin: 0.75rem 1rem 1rem;
  }
}

/* Mid widths: keep side-by-side, tighten art column so demo stays readable */
@media (min-width: 480px) and (max-width: 1023px) {
  .welcome-scene {
    grid-template-columns: minmax(0, 1.55fr) minmax(7.5rem, 32%);
    column-gap: 0.5rem;
    min-height: 18rem;
  }

  .welcome-scene-art {
    max-height: 16rem;
  }

  .welcome-scene-demo {
    margin: 0.85rem 0.35rem 0.85rem 0.85rem;
  }

  .welcome-scene-meta {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .welcome-scene-demo {
    animation: welcome-scene-in 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes welcome-scene-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Operate accent (Progress + Profile) — matches Home primary CTA (#111827), not mint. */
.progress-page,
.profile-page {
  --progress-accent: #111827;
  --progress-accent-hover: #030712;
  --progress-accent-soft: var(--teacher-surface-muted);
  --progress-accent-ink: #111827;
}

html[data-theme="dark"] .progress-page,
html[data-theme="dark"] .profile-page {
  --progress-accent: #F3F4F6;
  --progress-accent-hover: #FFFFFF;
  --progress-accent-soft: var(--teacher-surface-muted);
  --progress-accent-ink: #F3F4F6;
}

.progress-page.hidden {
  display: none !important;
}

.progress-page:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1.75rem;
  position: relative;
}

.progress-page-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: color-mix(in srgb, var(--teacher-surface, #fff) 88%, transparent);
  border-radius: 0;
}

.progress-page-loading.hidden,
.progress-page-loading[hidden] {
  display: none !important;
}

.progress-page-loading-text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
}

html[data-theme="dark"] .progress-page-loading-text {
  color: #d1d5db;
}

.progress-page-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  min-height: 2.75rem;
}

.progress-page-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--teacher-text);
}

.progress-next-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--teacher-border-strong);
  background: var(--progress-accent-soft);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.progress-next-hero-icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teacher-card);
  color: var(--progress-accent-ink);
  font-size: 0.875rem;
}

.progress-next-hero-copy {
  flex: 1 1 12rem;
  min-width: 0;
}

.progress-next-hero-title {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--teacher-text);
}

.progress-next-hero-phrase {
  margin-top: 0.15rem;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--teacher-text);
  overflow-wrap: anywhere;
}

.progress-next-hero-hint {
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  line-height: 1.4;
}

.progress-next-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 5.5rem;
  min-height: 2.75rem;
  height: 2.75rem;
  padding: 0 1.125rem;
  border-radius: 9999px;
  border: 0;
  background: var(--progress-accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.28);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

html[data-theme="dark"] .progress-next-cta {
  color: #12141A;
}

.progress-next-cta:hover {
  background: var(--progress-accent-hover);
  filter: brightness(1.05);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.32);
}

.progress-next-cta:active {
  background: var(--progress-accent-hover);
  transform: translateY(1px);
}

.progress-next-cta:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: 2px;
}

.progress-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  opacity: 0.85;
}

.progress-meta-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.3rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid var(--teacher-border);
  background: transparent;
  font-size: 0.75rem;
}

.progress-meta-label {
  font-weight: 500;
  color: var(--teacher-text-secondary);
}

.progress-meta-value {
  font-weight: 600;
  color: var(--teacher-text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}

.progress-panel-card {
  background: var(--teacher-card);
  border: 1px solid var(--teacher-border);
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 1rem 1rem;
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 640px) {
  .progress-panel-card {
    padding: 1.5rem 2rem;
  }
}

.progress-panel-card--follow {
  margin-top: 1rem;
}

.progress-charts-grid--summary {
  margin-top: 1rem;
}

.progress-panel-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teacher-text-secondary);
}

.progress-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--teacher-text);
}

.progress-panel-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  line-height: 1.4;
}

.progress-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .progress-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.progress-stat-tile {
  border-radius: 1rem;
  border: 1px solid var(--teacher-border);
  background: var(--teacher-surface-muted);
  padding: 0.75rem 1rem;
  min-width: 0;
}

.progress-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teacher-text-secondary);
}

.progress-stat-value {
  margin-top: 0.25rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--teacher-text);
  font-variant-numeric: tabular-nums;
}

.progress-stat-hint {
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  line-height: 1.35;
}

#progressLevelHint:not(.sr-only),
#progressQualityDelta {
  font-size: 0.8125rem;
  line-height: 1.35;
}

.progress-quality-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 1024px) {
  .progress-quality-grid {
    grid-template-columns: 7fr 5fr;
    gap: 1.25rem;
  }
}

.progress-goals-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.progress-goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teacher-text);
  min-width: 0;
}

.progress-goal-row > span:first-child {
  min-width: 0;
}

.progress-goal-row > span:last-child {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.progress-goal-track {
  margin-top: 0.35rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--teacher-surface-muted);
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.06);
}

.progress-goal-fill {
  height: 100%;
  background: var(--progress-accent);
  border-radius: 9999px;
  transition: width 0.25s ease;
}

.progress-goal-fill--mastery {
  background: var(--progress-accent-hover);
}

.progress-empty-msg {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  line-height: 1.4;
}

.progress-mastery-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .progress-mastery-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.progress-mastery-list,
.progress-sounds-list,
.progress-history-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 1024px) {
  .progress-charts-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
  }

  .progress-panel-card--wide {
    grid-column: 1 / -1;
  }
}

.progress-heatmap {
  margin-top: 1rem;
  min-height: 3.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.progress-heatmap-month {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teacher-text-secondary);
  /* Title casing comes from JS (keep "de" lowercase). */
  text-transform: none;
  margin-bottom: 0.5rem;
}

/* Shared 7-column track so weekday labels and day cells stay aligned. */
.progress-heatmap-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: 0.25rem;
  row-gap: 0.25rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.progress-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.35rem;
  width: 100%;
  min-height: 8.5rem;
  padding: 0.25rem 0 0;
  overflow-x: auto;
}

.progress-bar-col {
  flex: 0 0 auto;
  width: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.progress-bar-value {
  min-height: 0.95rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--teacher-text-secondary);
  font-variant-numeric: tabular-nums;
}

.progress-bar-value.is-empty {
  visibility: hidden;
}

.progress-bar-track {
  width: 0.5rem;
  height: 5.75rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.progress-bar-fill {
  width: 0.5rem;
  min-height: 0.25rem;
  border-radius: 9999px;
  background: var(--progress-accent);
}

.progress-bar-fill.is-empty {
  height: 4px !important;
  min-height: 4px;
  background: color-mix(in srgb, var(--progress-accent) 28%, var(--teacher-surface-muted));
}

.progress-bar-day {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--teacher-text-secondary);
  font-variant-numeric: tabular-nums;
}

.progress-goal-block {
  border-radius: 0.75rem;
  padding: 0.5rem 0.6rem;
  transition: background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.progress-goal-block.is-complete {
  background: var(--teacher-primary-soft);
  border-color: color-mix(in srgb, var(--progress-accent) 35%, var(--teacher-border));
}

.progress-goal-block.is-complete .progress-goal-row {
  color: var(--progress-accent-ink);
}

.progress-goal-block.is-complete .progress-goal-fill {
  background: var(--progress-accent);
}

.progress-heatmap-weekdays,
.progress-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: 0.25rem;
  row-gap: 0.25rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.progress-heatmap-calendar > .progress-heatmap-weekdays,
.progress-heatmap-calendar > .progress-heatmap-grid {
  grid-column: 1 / -1;
}

@supports (grid-template-columns: subgrid) {
  .progress-heatmap-calendar > .progress-heatmap-weekdays,
  .progress-heatmap-calendar > .progress-heatmap-grid {
    grid-template-columns: subgrid;
    column-gap: inherit;
  }
}

.progress-heatmap-weekdays {
  margin-bottom: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--teacher-text-secondary);
  text-align: center;
}

.progress-heatmap-weekdays > span {
  min-width: 0;
  display: block;
  text-align: center;
}

.progress-heatmap-grid {
  margin: 0;
}

.progress-heat-pad,
.progress-heat-cell {
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}

.progress-heat-cell {
  position: relative;
  border-radius: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-heat-daynum {
  font-size: clamp(0.625rem, 2.8vw, 0.6875rem); /* ≥10px, prefer 11px */
  font-weight: 600;
  line-height: 1;
  color: #374151;
  pointer-events: none;
}

.progress-heat-warm .progress-heat-daynum,
.progress-heat-hot .progress-heat-daynum {
  color: #fff;
}

html[data-theme="dark"] .progress-heat-daynum {
  color: var(--teacher-text-secondary);
}

html[data-theme="dark"] .progress-heat-warm .progress-heat-daynum,
html[data-theme="dark"] .progress-heat-hot .progress-heat-daynum {
  color: #12141A;
}

.progress-heatmap-incentive {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  line-height: 1.4;
}

.progress-chart-slot {
  margin-top: 1rem;
  min-height: 7.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.progress-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.progress-chart-summary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 5rem;
  justify-content: center;
}

.progress-chart-summary-current {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--teacher-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.progress-chart-summary-delta {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teacher-text-secondary);
}

.progress-chart-summary-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
}

.progress-line-svg .progress-chart-axis-label,
.progress-chart-axis-label {
  fill: var(--teacher-text-secondary);
  font-size: 9px;
  font-weight: 600;
}

.progress-badges-grid {
  margin-top: 1rem;
}

.progress-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--teacher-border);
  background: var(--teacher-surface-muted);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.progress-list-row:hover {
  background: var(--teacher-surface-hover);
  border-color: var(--teacher-border-strong);
}

.progress-list-row:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: 2px;
}

.progress-list-row-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teacher-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-list-row-meta {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
}

.progress-list-row-score {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--progress-accent-ink);
  font-variant-numeric: tabular-nums;
}

.progress-mastery-filter {
  border-radius: 1rem;
  border: 1px solid var(--teacher-border);
  background: var(--teacher-surface-muted);
  padding: 0.75rem 1rem;
  min-height: 3.25rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.progress-mastery-filter:hover {
  border-color: var(--teacher-border-strong);
  background: var(--teacher-surface-hover);
}

.progress-mastery-filter.is-selected,
.progress-mastery-filter[aria-pressed="true"] {
  border-color: var(--progress-accent);
  background: var(--progress-accent-soft);
  box-shadow: inset 0 0 0 1px var(--progress-accent);
}

.progress-mastery-filter:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: 2px;
}

.progress-mastery-filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teacher-text-secondary);
}

.progress-mastery-filter.is-selected .progress-mastery-filter-label,
.progress-mastery-filter[aria-pressed="true"] .progress-mastery-filter-label {
  color: var(--progress-accent-ink);
}

.progress-mastery-filter-count {
  margin-top: 0.25rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--teacher-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.progress-mastery-showing {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teacher-text-secondary);
}

.progress-insight-card {
  margin-top: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--teacher-border);
  background: var(--progress-accent-soft);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 1.25rem 1.5rem;
}

.progress-insight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.progress-insight-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--progress-accent-ink);
}

.progress-insight-periods {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.progress-insight-sublabel {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--progress-accent-ink);
}

.progress-insight-summary {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--teacher-text);
}

.progress-insight-skeleton {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-insight-block {
  margin-top: 1rem;
}

.progress-insight-list {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--teacher-text);
}

.progress-insight-list--focus {
  gap: 0.5rem;
}

.progress-insight-period {
  min-height: 2.75rem;
  height: 2.75rem;
  padding: 0 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: var(--progress-accent-ink);
  cursor: pointer;
}

.progress-insight-period.is-active,
.progress-insight-period[aria-pressed="true"] {
  background: var(--teacher-card);
  border-color: var(--teacher-border-strong);
  color: var(--progress-accent-ink);
}

.progress-insight-period:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: 2px;
}

.progress-insight-item {
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--teacher-card) 70%, transparent);
  border: 1px solid var(--teacher-border);
  padding: 0.5rem 0.75rem;
}

.progress-practice-btn {
  flex-shrink: 0;
  min-height: 2.75rem;
  height: 2.75rem;
  padding: 0 0.875rem;
  border-radius: 9999px;
  background: var(--progress-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}

html[data-theme="dark"] .progress-practice-btn {
  color: #12141A;
}

.progress-practice-btn:hover {
  background: var(--progress-accent-hover);
}

.progress-practice-btn:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: 2px;
}

.progress-practice-btn--ghost {
  background: transparent;
  color: var(--progress-accent-ink);
  border: 1px solid var(--teacher-border-strong);
}

.progress-practice-btn--ghost:hover {
  background: var(--progress-accent-soft);
}

.progress-heat-hot {
  background: var(--progress-accent);
}

.progress-heat-warm {
  background: color-mix(in srgb, var(--progress-accent) 55%, var(--teacher-surface-muted));
}

.progress-heat-empty {
  background: #E5E7EB;
}

html[data-theme="dark"] .progress-heat-empty {
  background: var(--teacher-surface-muted);
}

.progress-heat-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--progress-accent);
}

.progress-heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.progress-heatmap-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  flex: 0 1 auto;
  white-space: nowrap;
}

.progress-heatmap-legend .progress-heat-cell {
  width: 0.875rem;
  height: 0.875rem;
  min-width: 0.875rem;
  min-height: 0.875rem;
  max-width: 0.875rem;
  aspect-ratio: auto;
  flex-shrink: 0;
  border-radius: 0.25rem;
}

@media (max-width: 480px) {
  .progress-heatmap-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.75rem;
    row-gap: 0.5rem;
  }

  .progress-heatmap-legend-item {
    white-space: normal;
  }
}

.progress-mastery-row,
.progress-sound-row,
.progress-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--teacher-border);
  background: var(--teacher-surface-muted);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.progress-history-row:hover,
.progress-mastery-row:hover,
.progress-sound-row:hover {
  background: var(--teacher-surface-hover);
  border-color: var(--teacher-border-strong);
}

.progress-history-row:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: 2px;
}

.progress-mastery-row-title,
.progress-sound-row-title,
.progress-history-phrase {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teacher-text);
  overflow-wrap: anywhere;
}

.progress-mastery-row-meta,
.progress-sound-row-meta,
.progress-history-when {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
}

.progress-sound-trend {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
}

.progress-history-score {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--progress-accent-ink);
  font-variant-numeric: tabular-nums;
}

.progress-badges-grid-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .progress-badges-grid-inner {
    grid-template-columns: 1fr 1fr;
  }
}

.progress-badge {
  border-radius: 1rem;
  border: 1px solid var(--teacher-border);
  padding: 1rem;
  background: var(--teacher-surface-muted);
}

.progress-badge--gold {
  border-color: color-mix(in srgb, var(--teacher-amber) 45%, var(--teacher-border));
  background: color-mix(in srgb, var(--teacher-amber) 12%, var(--teacher-card));
}

.progress-badge--silver {
  border-color: var(--teacher-border-strong);
  background: var(--teacher-surface-muted);
}

.progress-badge--bronze {
  border-color: color-mix(in srgb, #C2410C 25%, var(--teacher-border));
  background: color-mix(in srgb, #C2410C 8%, var(--teacher-card));
}

.progress-badge.is-locked {
  opacity: 0.72;
  filter: grayscale(0.55) saturate(0.65);
}

.progress-badge.is-unlocked {
  opacity: 1;
  filter: none;
}

.progress-badge-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.progress-badge-icon {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teacher-card);
  border: 1px solid var(--teacher-border);
  color: var(--teacher-text);
  flex-shrink: 0;
}

.progress-badge.is-unlocked .progress-badge-icon {
  color: var(--progress-accent-ink);
  border-color: color-mix(in srgb, var(--progress-accent) 40%, var(--teacher-border));
  background: var(--teacher-primary-soft);
}

.progress-badge-status {
  position: absolute;
  right: -0.2rem;
  bottom: -0.2rem;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  border: 1.5px solid var(--teacher-card);
  background: var(--teacher-surface-muted);
  color: var(--teacher-text-secondary);
}

.progress-badge.is-unlocked .progress-badge-status {
  background: var(--progress-accent);
  color: #fff;
}

.progress-badge.is-locked .progress-badge-status {
  background: var(--teacher-surface-hover);
  color: var(--teacher-text-secondary);
}

.progress-badge-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--teacher-text);
}

.progress-badge-desc {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  line-height: 1.35;
}

.progress-badge-unlocked {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--progress-accent-ink);
}

.progress-badge-track {
  margin-top: 0.5rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--teacher-card) 80%, transparent);
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.06);
}

.progress-badge-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--progress-accent);
}

.progress-badge-progress {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  font-variant-numeric: tabular-nums;
}

.progress-activity-footer {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  padding: 0 0.25rem;
  line-height: 1.4;
}

.progress-activity-xp {
  opacity: 0.55;
}

.progress-detail-panel {
  min-width: 0;
}

.progress-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.125rem;
}

.progress-tab {
  flex: 0 0 auto;
  min-height: 2.75rem;
  height: 2.75rem;
  padding: 0 1rem;
  border-radius: 9999px;
  border: 1px solid var(--teacher-border);
  background: var(--teacher-card);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teacher-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.progress-tab:hover {
  background: var(--teacher-surface-hover);
  color: var(--teacher-text);
}

.progress-tab[aria-selected="true"] {
  background: var(--progress-accent);
  border-color: var(--progress-accent);
  color: #fff;
}

html[data-theme="dark"] .progress-tab[aria-selected="true"] {
  color: #12141A;
}

.progress-tab:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: 2px;
}

.progress-tab-panel:focus {
  outline: none;
}

.progress-tab-panel:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .progress-next-cta,
  .progress-goal-fill {
    transition: none;
  }
  .progress-next-cta:active {
    transform: none;
  }
}

@media (max-width: 380px) {
  .progress-next-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .progress-next-cta {
    width: 100%;
  }
}

@media (min-width: 1024px) {
  .progress-page {
    gap: 1.125rem;
    width: 100%;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
  }
}

html[data-theme="dark"] .progress-next-hero {
  box-shadow: none;
}

html[data-theme="dark"] .progress-next-hero-icon {
  background: var(--teacher-surface-muted);
}

html[data-theme="dark"] .progress-next-cta {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

html[data-theme="dark"] .progress-panel-card,
html[data-theme="dark"] .progress-insight-card {
  box-shadow: none;
}

html[data-theme="dark"] .progress-goal-track {
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.25);
}

html[data-theme="dark"] .progress-tab:not([aria-selected="true"]) {
  background: var(--teacher-surface-muted);
  color: var(--teacher-text-secondary);
  border-color: var(--teacher-border);
}

html[data-theme="dark"] .progress-tab:not([aria-selected="true"]):hover {
  background: var(--teacher-surface-hover);
  color: var(--teacher-text);
}

html[data-theme="dark"] .progress-tab[aria-selected="true"] {
  background: var(--progress-accent);
  border-color: var(--progress-accent);
  color: #12141A;
}

html[data-theme="dark"] .progress-heat-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--progress-accent);
}

html[data-theme="dark"] .progress-badge-icon {
  background: var(--teacher-surface-muted);
}

#bottomNav button.is-active {
  color: var(--teacher-primary);
}
/* Profile: compact identity + sectioned list rows
   Accent/type aligned to Progress (--progress-accent on .profile-page). */
/* display:flex must not beat Tailwind .hidden (same specificity; this file loads later) */
.profile-page.hidden {
  display: none !important;
}

.profile-page:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1.75rem;
}

.profile-page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
}

.profile-page-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--teacher-text);
}

.profile-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 1rem;
  border-radius: 1rem;
  border: 1px solid var(--teacher-border);
  background: var(--teacher-card);
  color: var(--teacher-text);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.profile-back-btn:hover {
  background: var(--teacher-surface-hover);
  border-color: var(--teacher-border-strong);
}

.profile-back-btn:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: 2px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  min-height: 3.25rem;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0.5rem 0.25rem;
  margin: 0;
  border-radius: 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.profile-identity:hover {
  background: var(--teacher-surface-hover);
}

.profile-identity:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: 2px;
}

.profile-avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 9999px;
  background: var(--progress-accent-soft);
  color: var(--progress-accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.125rem;
  font-weight: 800;
}

.profile-identity-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.profile-identity-name {
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: 800;
  color: var(--teacher-text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-plan-badge {
  display: inline-flex;
  align-items: center;
  height: 1.5rem;
  padding: 0 0.625rem;
  border-radius: 9999px;
  border: 1px solid var(--teacher-border-strong);
  background: var(--progress-accent-soft);
  color: var(--progress-accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.profile-identity-email {
  font-size: 0.8125rem;
  line-height: 1.35;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-highlight-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--teacher-border-strong);
  background: var(--progress-accent-soft);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.profile-highlight-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: var(--teacher-card);
  color: var(--progress-accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.profile-highlight-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--teacher-text);
  line-height: 1.25;
}

.profile-highlight-desc {
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  line-height: 1.4;
}

.profile-highlight-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  min-height: 2.75rem;
  height: 2.75rem;
  padding: 0 1.125rem;
  border-radius: 9999px;
  border: 0;
  background: var(--progress-accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.28);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

html[data-theme="dark"] .profile-highlight-cta {
  color: #12141A;
}

.profile-highlight-cta:hover {
  background: var(--progress-accent-hover);
  filter: brightness(1.05);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.32);
}

.profile-highlight-cta:active {
  background: var(--progress-accent-hover);
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.22);
}

.profile-highlight-cta:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .profile-highlight-cta {
    transition: background 0.15s ease, box-shadow 0.15s ease;
  }

  .profile-highlight-cta:active {
    transform: none;
  }

  .profile-achv-bar-fill {
    transition: none;
  }
}

@media (max-width: 380px) {
  .profile-highlight-card {
    flex-wrap: wrap;
  }
  .profile-highlight-cta {
    width: 100%;
  }
}

.profile-section {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.35rem;
}

.profile-section-label {
  margin: 0;
  padding: 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teacher-text-secondary);
}

.profile-card {
  background: var(--teacher-card);
  border: 1px solid var(--teacher-border);
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: 0;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

a.profile-row {
  color: inherit;
}

.profile-row:hover {
  background: var(--teacher-surface-hover);
}

.profile-row:focus-visible {
  outline: 2px solid var(--progress-accent);
  outline-offset: -2px;
}

.profile-row--static {
  cursor: default;
}

.profile-row--static:hover {
  background: transparent;
}

.profile-row-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: var(--progress-accent-soft);
  color: var(--progress-accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.profile-row-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--teacher-text);
}

.profile-row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-row-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.profile-row-label-row .profile-row-label {
  flex: 1 1 auto;
}

.profile-row-value {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--teacher-text-secondary);
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.profile-row-value--action {
  color: var(--progress-accent-ink);
}

.profile-row-chevron {
  flex-shrink: 0;
  width: 0.75rem;
  text-align: center;
  font-size: 0.6875rem;
  color: var(--teacher-text-secondary);
}

.profile-row-divider {
  height: 1px;
  margin-left: calc(1rem + 2.25rem + 0.75rem);
  margin-right: 1rem;
  background: var(--teacher-border);
}

.profile-row--achv {
  align-items: flex-start;
  min-height: 0;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

.profile-row--achv .profile-row-icon {
  margin-top: 0.05rem;
}

.profile-row--achv .profile-row-chevron {
  margin-top: 0.3rem;
}

.profile-achv-title {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--teacher-text-secondary);
  line-height: 1.4;
}

.profile-achv-bar {
  margin-top: 0.5rem;
  height: 0.5rem;
  width: 100%;
  border-radius: 9999px;
  background: var(--teacher-surface-muted);
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.06);
}

.profile-achv-bar-fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--progress-accent);
  transition: width 0.25s ease;
}

.profile-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  margin-top: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  border: 1px solid #fca5a5;
  background: var(--teacher-card);
  color: #b91c1c;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.profile-logout-btn:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}

.profile-logout-btn:focus-visible {
  outline: 2px solid #b91c1c;
  outline-offset: 2px;
}

@media (min-width: 1024px) {
  .profile-page {
    gap: 1.125rem;
    width: 100%;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
  }

  .profile-section {
    margin-top: 0.5rem;
  }
}

html[data-theme="dark"] .profile-highlight-card {
  box-shadow: none;
}

html[data-theme="dark"] .profile-highlight-icon {
  background: var(--teacher-surface-muted);
}

html[data-theme="dark"] .profile-highlight-cta {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

html[data-theme="dark"] .profile-back-btn {
  background: var(--teacher-card);
  border-color: var(--teacher-border);
  color: var(--teacher-text);
}

html[data-theme="dark"] .profile-back-btn:hover {
  background: var(--teacher-surface-hover);
}

html[data-theme="dark"] .profile-card {
  box-shadow: none;
}

html[data-theme="dark"] .profile-achv-bar {
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.25);
}

html[data-theme="dark"] .profile-logout-btn {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.55);
  color: #fca5a5;
}

html[data-theme="dark"] .profile-logout-btn:hover {
  background: rgba(248, 113, 113, 0.14);
  border-color: #f87171;
  color: #fecaca;
}

.progress-skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, var(--teacher-surface-muted), var(--teacher-surface-hover), var(--teacher-surface-muted));
  background-size: 200% 100%;
  animation: progress-shimmer 1.2s ease-in-out infinite;
}
.progress-skeleton-chart {
  height: 120px;
}
.progress-skeleton-heatmap {
  height: 56px;
}
.progress-skeleton-row {
  height: 56px;
}
.progress-skeleton-line {
  height: 14px;
  width: 100%;
}
.progress-skeleton-line-short {
  width: 64%;
}
@keyframes progress-shimmer {
  0% { background-position: 100% 0; opacity: 0.7; }
  50% { opacity: 1; }
  100% { background-position: -100% 0; opacity: 0.7; }
}

/* ---- Dark theme: component surfaces & contrast ---- */
html[data-theme="dark"] .practice-level-intermediate {
    color: #FBBF24;
}

html[data-theme="dark"] .home-mode-tag {
    background: rgba(147, 197, 253, 0.14);
    color: #93C5FD;
}

html[data-theme="dark"] .topic-selector:hover {
    background-color: rgba(59, 130, 246, 0.18);
    color: #93C5FD;
}

html[data-theme="dark"] #practiceTranslation,
html[data-theme="dark"] #translationText {
    color: var(--teacher-text-secondary);
}

html[data-theme="dark"] .word-by-word .clickable-word:hover {
    background-color: rgba(59, 130, 246, 0.2);
}

html[data-theme="dark"] .word-by-word .word-speaking {
    background-color: rgba(62, 207, 142, 0.2);
    color: var(--teacher-primary);
    box-shadow: 0 2px 4px rgba(62, 207, 142, 0.25);
}

html[data-theme="dark"] .word-score-70,
html[data-theme="dark"] .word-score-60 {
    color: #6EE7B7;
}

html[data-theme="dark"] .teacher-sidebar-stat-card,
html[data-theme="dark"] .teacher-sidebar-profile-reminder,
html[data-theme="dark"] #userMenuDropdown {
    background: var(--teacher-card);
    border-color: var(--teacher-border);
}

html[data-theme="dark"] .swal2-popup {
    background: var(--teacher-card) !important;
    color: var(--teacher-text) !important;
}

html[data-theme="dark"] .swal2-title,
html[data-theme="dark"] .swal2-html-container,
html[data-theme="dark"] .swal2-content {
    color: var(--teacher-text) !important;
}

html[data-theme="dark"] .swal2-input,
html[data-theme="dark"] .swal2-textarea,
html[data-theme="dark"] .swal2-select {
    background: var(--teacher-surface-muted) !important;
    color: var(--teacher-text) !important;
    border-color: var(--teacher-border-strong) !important;
}

html[data-theme="dark"] .progress-skeleton {
    background: linear-gradient(90deg, #1C1F28, #2E3340, #1C1F28);
    background-size: 200% 100%;
}

html[data-theme="dark"] .loading-spinner {
    background: conic-gradient(var(--teacher-primary), rgba(28, 31, 40, 0.35));
}

html[data-theme="dark"] .premium-upsell-card {
    filter: saturate(1.05) brightness(0.95);
}

html[data-theme="dark"] .home-daily-trail-marker {
    background: var(--teacher-surface-hover);
    border-color: rgba(255, 255, 255, 0.38);
    color: #F3F4F6;
}

html[data-theme="dark"] .home-daily-trail-step.is-pending .home-daily-trail-marker {
    color: #F9FAFB;
}

html[data-theme="dark"] .home-daily-trail-step.is-in_progress .home-daily-trail-marker,
html[data-theme="dark"] .home-daily-trail-step.is-current .home-daily-trail-marker {
    border-color: #60A5FA;
    color: #93C5FD;
    background: rgba(59, 130, 246, 0.16);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.22);
}

html[data-theme="dark"] .home-daily-trail-hint {
    color: #CBD5E1;
}

html[data-theme="dark"] .home-daily-trail-step.is-done .home-daily-trail-hint {
    color: #6EE7B7;
}

html[data-theme="dark"] .home-daily-trail-step.is-current .home-daily-trail-hint,
html[data-theme="dark"] .home-daily-trail-step.is-in_progress .home-daily-trail-hint {
    color: #E5E7EB;
}

html[data-theme="dark"] .home-daily-trail-label {
    color: var(--teacher-text);
}

html[data-theme="dark"] .songs-card-btn {
    background: var(--teacher-surface-hover);
    border-color: rgba(255, 255, 255, 0.22);
    color: #F3F4F6;
}

html[data-theme="dark"] .songs-card-btn:hover {
    background: #3A4050;
    border-color: rgba(255, 255, 255, 0.32);
}

html[data-theme="dark"] .songs-card-btn-danger {
    color: #FCA5A5;
    border-color: rgba(248, 113, 113, 0.4);
    background: transparent;
}

html[data-theme="dark"] .songs-chip {
    background: var(--teacher-surface-hover);
    color: #E5E7EB;
}

html[data-theme="dark"] .songs-badge-free {
    color: #6EE7B7;
}

html[data-theme="dark"] .songs-badge-pro {
    color: #FBBF24;
}

html[data-theme="dark"] #songsPage .text-gray-900,
html[data-theme="dark"] #songsViewCatalog .text-gray-900 {
    color: #F9FAFB !important;
}

html[data-theme="dark"] .practice-unit-card,
html[data-theme="dark"] .practice-unit-card--tile {
    background: var(--teacher-card);
    border-color: var(--teacher-border);
}

html[data-theme="dark"] .welcome-page,
html[data-theme="dark"] .welcome-scene,
html[data-theme="dark"] .onboarding-page,
html[data-theme="dark"] .songs-page,
html[data-theme="dark"] .progress-page,
html[data-theme="dark"] .chat-page,
html[data-theme="dark"] #initialMenuPage,
html[data-theme="dark"] #homePage,
html[data-theme="dark"] #progressPage,
html[data-theme="dark"] #songsPage,
html[data-theme="dark"] #chatPage,
html[data-theme="dark"] #recordingPage,
html[data-theme="dark"] #resultsPage {
    color: var(--teacher-text);
}

html[data-theme="dark"] .welcome-offer-line,
html[data-theme="dark"] .welcome-page--lean .welcome-offer-line,
html[data-theme="dark"] .welcome-footer-credit {
    color: #CBD5E1;
}

html[data-theme="dark"] .welcome-legal-line {
    color: #CBD5E1;
}

html[data-theme="dark"] .welcome-legal-link {
    color: #E2E8F0;
}

html[data-theme="dark"] .welcome-legal-link:hover {
    color: #F8FAFC;
}

html[data-theme="dark"] .auth-reset-saved-btn {
    color: #CBD5E1;
}

html[data-theme="dark"] .auth-reset-saved-btn:hover {
    color: #F1F5F9;
}

html[data-theme="dark"] .auth-offer-meta,
html[data-theme="dark"] .auth-offer-meta #authFreePlanLimits,
html[data-theme="dark"] .auth-offer-meta #authOfferAfterFree {
    color: #CBD5E1 !important;
}

html[data-theme="dark"] .auth-offer-meta #authOfferTitle {
    color: #E2E8F0 !important;
}

html[data-theme="dark"] .not-found-card {
    background: var(--teacher-card);
    border-color: var(--teacher-border);
}

html[data-theme="dark"] .not-found-title {
    color: var(--teacher-text);
}

html[data-theme="dark"] .not-found-lead {
    color: #CBD5E1;
}

html[data-theme="dark"] .focus\:ring-offset-2:focus {
    --tw-ring-offset-color: var(--teacher-bg);
}

html[data-theme="dark"] .ring-offset-white {
    --tw-ring-offset-color: var(--teacher-bg);
}

/* Soft pastel panels that stay light in dark mode → tinted translucent */
html[data-theme="dark"] .bg-indigo-50,
html[data-theme="dark"] .bg-violet-50,
html[data-theme="dark"] .bg-fuchsia-50,
html[data-theme="dark"] .bg-pink-50,
html[data-theme="dark"] .bg-orange-50,
html[data-theme="dark"] .bg-sky-50,
html[data-theme="dark"] .bg-teal-50,
html[data-theme="dark"] .bg-cyan-50 {
    background-color: var(--teacher-surface-muted) !important;
}

html[data-theme="dark"] .text-indigo-600,
html[data-theme="dark"] .text-indigo-700,
html[data-theme="dark"] .text-violet-700 {
    color: var(--teacher-secondary) !important;
}

html[data-theme="dark"] .text-orange-600,
html[data-theme="dark"] .text-orange-700 {
    color: #FB923C !important;
}

html[data-theme="dark"] .border-indigo-100,
html[data-theme="dark"] .border-indigo-200,
html[data-theme="dark"] .border-orange-100,
html[data-theme="dark"] .border-orange-200 {
    border-color: var(--teacher-border) !important;
}

html[data-theme="dark"] #bottomNav button.is-active,
html[data-theme="dark"] #bottomNav .is-active {
    color: var(--teacher-primary) !important;
}

html[data-theme="dark"] .from-white,
html[data-theme="dark"] .via-white,
html[data-theme="dark"] .to-white {
    --tw-gradient-from: var(--teacher-card);
    --tw-gradient-to: var(--teacher-card);
}

/* ---- Dark contrast: songs ghost + practice topics ---- */
html[data-theme="dark"] .songs-btn-ghost {
    color: #F9FAFB;
    border-color: rgba(255, 255, 255, 0.28);
    background: var(--teacher-surface-hover);
}

html[data-theme="dark"] .songs-btn-ghost:hover:not(:disabled) {
    color: #FFFFFF;
    background: #3A4050;
    border-color: rgba(255, 255, 255, 0.4);
}

html[data-theme="dark"] .songs-btn-ghost:disabled {
    opacity: 0.55;
    color: #D1D5DB;
}

html[data-theme="dark"] .songs-btn-secondary {
    background: var(--teacher-surface-hover);
    color: #F9FAFB;
    border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="dark"] .songs-action-nav .songs-btn-ghost {
    color: #FFFFFF;
    background: #343A48;
    border-color: rgba(255, 255, 255, 0.32);
    min-width: 6.5rem;
}

html[data-theme="dark"] .practice-topic-block-label {
    color: #CBD5E1;
}

html[data-theme="dark"] .practice-topic-more {
    color: var(--teacher-primary);
}

html[data-theme="dark"] .practice-topic-more[aria-expanded="true"] {
    color: #CBD5E1;
}

html[data-theme="dark"] .practice-topic-link {
    background: var(--teacher-surface-hover);
    border-color: rgba(255, 255, 255, 0.18);
    color: #F3F4F6;
}

html[data-theme="dark"] .practice-topic-link:hover {
    background: rgba(96, 165, 250, 0.16);
    border-color: rgba(96, 165, 250, 0.45);
    color: #93C5FD;
}

html[data-theme="dark"] .practice-topic-link:hover .practice-topic-link-chevron {
    color: #93C5FD;
}

html[data-theme="dark"] .practice-topic-link.is-progress {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(96, 165, 250, 0.45);
    color: #BFDBFE;
}

html[data-theme="dark"] .practice-topic-link.is-done {
    background: rgba(62, 207, 142, 0.16);
    border-color: rgba(62, 207, 142, 0.4);
    color: #6EE7B7;
}

html[data-theme="dark"] .practice-topic-link.is-locked {
    color: #9CA3AF;
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .practice-topic-link-chevron {
    color: #CBD5E1;
}

html[data-theme="dark"] .practice-topic-status--progress {
    background: rgba(59, 130, 246, 0.28);
    color: #BFDBFE;
}

html[data-theme="dark"] .practice-topic-status--done {
    background: rgba(62, 207, 142, 0.2);
    color: #6EE7B7;
}

html[data-theme="dark"] .practice-topic-link-pro {
    color: #FBBF24;
    background: rgba(239, 159, 39, 0.2);
}

html[data-theme="dark"] .practice-unit-card--tile .practice-unit-button--ghost {
    background: var(--teacher-surface-hover);
    border-color: rgba(255, 255, 255, 0.22);
    color: #F3F4F6;
}

html[data-theme="dark"] .practice-unit-card--tile .practice-unit-button--ghost:hover {
    background: #3A4050;
    border-color: rgba(96, 165, 250, 0.45);
    color: #93C5FD;
}

html[data-theme="dark"] .topic-selector.practice-topic-link.is-progress {
    color: #BFDBFE;
}

html[data-theme="dark"] .topic-selector.practice-topic-link.is-done {
    color: #6EE7B7;
}

/* —— Usage limits meter (Free plan) —— */
.usage-limits-meter-slot:not(.hidden) {
  display: block;
}

.usage-meter {
  border: 1px solid var(--teacher-border, rgba(0, 0, 0, 0.08));
  border-radius: 1rem;
  background: var(--teacher-card, #fff);
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.usage-meter--pro {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--teacher-primary-soft, #e1f5ee);
  border-color: rgba(15, 110, 86, 0.18);
}

.usage-meter-pro-badge {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.65rem;
  background: var(--teacher-card, #fff);
  color: var(--teacher-primary-dark, #0f6e56);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.usage-meter-pro-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--teacher-primary-dark, #0f6e56);
  line-height: 1.3;
}

.usage-meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.usage-meter-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teacher-text-secondary, #4b5563);
}

.usage-meter-upgrade {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teacher-primary-dark, #0f6e56);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.usage-meter-upgrade:hover {
  color: var(--teacher-primary, #1d9e75);
}

.usage-meter-rows {
  display: grid;
  gap: 0.7rem;
}

.usage-meter-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.usage-meter-row-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teacher-text, #1a1a1a);
}

.usage-meter-row-value {
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--teacher-text, #1a1a1a);
}

.usage-meter-track {
  margin-top: 0.35rem;
  height: 0.4rem;
  border-radius: 9999px;
  background: var(--teacher-surface-muted, #f5f5f7);
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.06);
}

.usage-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teacher-primary, #1d9e75);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.usage-meter-row.is-exhausted .usage-meter-fill {
  background: var(--teacher-amber, #ef9f27);
}

.usage-meter-row-meta {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teacher-text-secondary, #4b5563);
}

.usage-meter-row.is-exhausted .usage-meter-row-meta {
  color: #92400e;
  font-weight: 600;
}

.usage-limits-meter-slot--chat .usage-meter {
  border-radius: 0.85rem;
  padding: 0.7rem 0.85rem;
}

html[data-theme="dark"] .usage-meter {
  background: var(--teacher-card);
  border-color: var(--teacher-border);
}

html[data-theme="dark"] .usage-meter-title,
html[data-theme="dark"] .usage-meter-row-meta {
  color: var(--teacher-text-secondary);
}

html[data-theme="dark"] .usage-meter-row-label,
html[data-theme="dark"] .usage-meter-row-value {
  color: var(--teacher-text);
}

html[data-theme="dark"] .usage-meter-upgrade {
  color: var(--teacher-primary);
}

html[data-theme="dark"] .usage-meter--pro {
  background: var(--teacher-primary-soft);
}

html[data-theme="dark"] .usage-meter-pro-label {
  color: var(--teacher-primary);
}

html[data-theme="dark"] .usage-meter-row.is-exhausted .usage-meter-row-meta {
  color: #fbbf24;
}

@media (prefers-reduced-motion: reduce) {
  .usage-meter-fill {
    transition: none;
  }
}

/* —— Mic check sheet —— */
.mic-check-sheet {
  max-height: min(92vh, 36rem);
  overflow: auto;
}

.mic-check-tips {
  margin: 0;
  padding: 0.85rem 1rem 0.85rem 1.35rem;
  list-style: disc;
  border-radius: 1rem;
  background: var(--teacher-primary-soft, #e1f5ee);
  border: 1px solid rgba(15, 110, 86, 0.14);
  display: grid;
  gap: 0.4rem;
}

.mic-check-tips li {
  font-size: 0.875rem;
  line-height: 1.4;
  color: #1f2937;
  font-weight: 500;
}

.mic-check-meter-wrap {
  display: grid;
  gap: 0.4rem;
}

.mic-check-meter-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #374151;
}

.mic-check-meter-track {
  height: 0.55rem;
  border-radius: 9999px;
  background: #f5f5f7;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.06);
}

.mic-check-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: #0f6e56;
  transition: width 0.08s linear;
}

.mic-check-status {
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #1f2937;
  font-weight: 500;
}

.mic-check-actions {
  display: grid;
  gap: 0.55rem;
}

.mic-check-test-btn {
  width: 100%;
}

html[data-theme="dark"] .mic-check-sheet {
  background: var(--teacher-card);
}

html[data-theme="dark"] .mic-check-tips {
  background: var(--teacher-primary-soft);
  border-color: rgba(62, 207, 142, 0.25);
}

html[data-theme="dark"] .mic-check-tips li,
html[data-theme="dark"] .mic-check-status,
html[data-theme="dark"] .mic-check-meter-label {
  color: var(--teacher-text);
}

html[data-theme="dark"] .mic-check-meter-track {
  background: var(--teacher-surface-muted);
}

html[data-theme="dark"] .mic-check-meter-fill {
  background: var(--teacher-primary);
}

@media (prefers-reduced-motion: reduce) {
  .mic-check-meter-fill {
    transition: none;
  }
}

/* —— Mic failure sheet (reuse mic-check chrome) —— */
.mic-failure-sheet .welcome-btn i {
  margin-right: 0.4rem;
}

.mic-failure-type-input {
  resize: vertical;
  min-height: 4.5rem;
  color: #111827;
  background: #fff;
}

html[data-theme="dark"] .mic-failure-sheet {
  background: var(--teacher-card);
}

html[data-theme="dark"] #micFailureTitle,
html[data-theme="dark"] #micFailureMessage,
html[data-theme="dark"] #micFailureTypePanel label,
html[data-theme="dark"] #micFailureTypePanel p {
  color: var(--teacher-text);
}

html[data-theme="dark"] .mic-failure-type-input {
  background: var(--teacher-surface-muted);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--teacher-text);
}

/* —— Welcome: music + plans —— */
.welcome-music-line {
  margin: 0.85rem 0 0;
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 28rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.85rem;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: #1e3a8a;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}

.welcome-music-line i {
  margin-top: 0.15rem;
  color: #1d4ed8;
  flex-shrink: 0;
}

.welcome-plans-link {
  color: #0f6e56;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.welcome-plans-link:hover {
  color: #0a5441;
}

.welcome-page--lean .welcome-music-line {
  margin-top: 0.65rem;
}

html[data-theme="dark"] .welcome-music-line {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(147, 197, 253, 0.28);
  color: #dbeafe;
}

html[data-theme="dark"] .welcome-music-line i {
  color: #93c5fd;
}

html[data-theme="dark"] .welcome-plans-link {
  color: var(--teacher-primary);
}
