/* ==============================================================================
   Francês Adaptativo — Componentes
   Navegação superior, superfícies calmas e feedback de baixa intensidade.
   ============================================================================== */

/* ==============================================================================
   1. Barra superior de navegação
   ============================================================================== */

#topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

/* Gate de login: esconde navegação e chrome de usuário autenticado */
body.app-guest #primary-nav,
body.app-guest #daily-progress,
body.app-guest .topbar-meta,
body.app-guest .avatar-btn,
body.app-guest a.icon-btn[href="#/configuracoes"],
body.app-guest .donation-topbar-link,
body.app-guest .header-logout-btn {
  display: none !important;
}

body.app-guest #topbar {
  box-shadow: none;
}

body.app-guest #app-content {
  min-height: calc(100vh - var(--topbar-height, 66px) - 2rem);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.auth-shell {
  width: 100%;
  max-width: 460px;
  margin: 2.5rem auto 3rem;
  padding: 0 1rem;
}

.auth-shell--wide {
  max-width: 560px;
}

.auth-card {
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--primary);
}

.auth-card-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-card-header .auth-icon {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

/* Bandeira em SVG reaproveitada em telas de auth e cadastro */
.lang-flag {
  display: block;
  width: 1.45rem;
  height: 1.02rem;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.lang-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Login: o idioma ainda não foi escolhido, então os dois aparecem lado a lado */
.auth-lang-duo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.75rem 0.32rem 0.38rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.auth-lang-sep {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-card-header h1,
.auth-card-header h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.auth-card-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.auth-footer-links {
  margin-top: var(--space-4);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-footer-links a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.header-logout-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.header-logout-btn:hover {
  color: var(--danger, #b91c1c);
  border-color: color-mix(in srgb, var(--danger, #b91c1c) 35%, var(--border));
}

.profile-session-card {
  border: 1px solid color-mix(in srgb, var(--danger, #b91c1c) 25%, var(--border));
}

.topbar-row {
  height: var(--topbar-height);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* --- Marca --- */
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text-strong);
  flex-shrink: 0;
}

.brand:hover { color: var(--text-strong); }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
}

.brand-mark.brand-mark--flag,
.brand-mark:has(svg) {
  background: transparent;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}

/* Antes do login não há idioma escolhido: as duas bandeiras aparecem juntas */
.brand-mark.brand-mark--dual {
  width: auto;
  height: auto;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  gap: 4px;
}

.brand-mark--dual .brand-flag {
  display: block;
  width: 28px;
  height: 19px;
  flex: 0 0 auto;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.brand-mark--dual .brand-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.header-lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.header-lang-flag.header-lang-flag--svg,
.header-lang-flag:has(svg) {
  width: 1.15rem;
  height: 0.82rem;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.header-lang-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-strong);
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* --- Metadados e ações --- */
.topbar-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.user-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--accent-warm-soft);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold-light);
  font-weight: 600;
  font-size: 0.82rem;
}

.api-status {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0 0.25rem;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.icon-btn:hover {
  background: var(--surface-3);
  border-color: var(--border);
  color: var(--text-primary);
}

/* Compatibilidade com o toggle de tema anterior */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.avatar-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* --- Trilha de navegação --- */
.nav-rail {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.nav-rail-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
  height: var(--navrail-height);
  display: flex;
  align-items: center;
  gap: 0.2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}

.nav-rail-inner::-webkit-scrollbar { display: none; }

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  scroll-snap-align: center;
  flex-shrink: 0;
}

.nav-item .nav-icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.85;
}

.nav-item:hover {
  color: var(--text-strong);
  background: var(--surface-3);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-light);
  font-weight: 600;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 0.5rem;
  flex-shrink: 0;
}

/* --- Progresso diário: barra fina sob a navegação (efeito de meta) --- */
.daily-progress {
  height: 3px;
  background: var(--surface-3);
  overflow: hidden;
}

.daily-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--grad-primary);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==============================================================================
   2. Botões
   ============================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
              color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--primary-contrast);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary-light);
}

.btn-outline:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface-3);
  color: var(--text-strong);
}

.btn-accent {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.btn-accent:hover {
  color: #ffffff;
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}

.btn-success:hover { color: #ffffff; filter: brightness(1.05); transform: translateY(-1px); }

.btn-danger {
  background: var(--error-light);
  color: var(--error);
  border-color: var(--error-light);
}

.btn-danger:hover { background: var(--error); color: #ffffff; }

.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 0.38rem 0.8rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-block { width: 100%; }

/* ==============================================================================
   3. Cartões e superfícies
   ============================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal), transform var(--transition-normal);
  position: relative;
}

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

.card-soft {
  background: var(--surface-2);
  box-shadow: none;
}

.card-interactive { cursor: pointer; }

.card-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.card-gradient-border {
  overflow: hidden;
}

.card-gradient-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-primary);
  opacity: 0.9;
}

.card-highlight {
  background: var(--primary-soft);
  border-color: var(--primary-light);
  box-shadow: none;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-strong);
  margin-bottom: 0.35rem;
}

/* ==============================================================================
   4. Etiquetas / badges
   ============================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Badges com texto longo (ex.: temas do plano semanal) */
.badge-wrap {
  display: inline-flex;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  height: auto;
  align-items: flex-start;
  box-sizing: border-box;
}

.badge-a1 { background: rgba(93, 144, 119, 0.12); color: var(--level-a1); border-color: rgba(93, 144, 119, 0.25); }
.badge-a2 { background: rgba(75, 139, 139, 0.12); color: var(--level-a2); border-color: rgba(75, 139, 139, 0.25); }
.badge-b1 { background: rgba(90, 127, 160, 0.12); color: var(--level-b1); border-color: rgba(90, 127, 160, 0.25); }
.badge-b2 { background: rgba(117, 117, 158, 0.12); color: var(--level-b2); border-color: rgba(117, 117, 158, 0.25); }
.badge-c1 { background: rgba(150, 109, 145, 0.12); color: var(--level-c1); border-color: rgba(150, 109, 145, 0.25); }
.badge-c2 { background: rgba(180, 129, 60, 0.12); color: var(--level-c2); border-color: rgba(180, 129, 60, 0.25); }

.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-light); }
.badge-secondary { background: var(--secondary-soft); color: var(--secondary); border-color: var(--secondary-light); }
.badge-accent { background: var(--accent-warm-soft); color: var(--accent-gold); border-color: var(--accent-gold-light); }
.badge-success { background: var(--success-light); color: var(--success); border-color: var(--success-light); }
.badge-warning { background: var(--warning-light); color: var(--warning); border-color: var(--warning-light); }
.badge-error { background: var(--error-light); color: var(--error); border-color: var(--error-light); }
.badge-info { background: var(--info-light); color: var(--info); border-color: var(--info-light); }
.badge-muted { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); }

/* ==============================================================================
   5. Barras de progresso
   ============================================================================== */

.progress-bar,
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill,
.progress-bar-fill {
  display: block;
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==============================================================================
   6. Formulários
   ============================================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.input, .select, .textarea {
  width: 100%;
  padding: 0.68rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.93rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  outline: none;
}

.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.input::placeholder, .textarea::placeholder { color: var(--text-muted); }

select.input, .select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 1.85rem;
  text-overflow: ellipsis;
}

/* Selects nativos usados em views (sem classe) herdam a mesma linguagem visual */
#app-content select:not(.select):not(.input) {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.45rem 0.7rem;
}

/* ==============================================================================
   7. Chips e opções selecionáveis
   ============================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover { border-color: var(--border-strong); color: var(--text-strong); }

.chip.active,
.chip[aria-pressed="true"] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.interest-chip.active,
.hobby-chip.active {
  background: var(--primary-soft) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* Cartões de escolha (nível CEFR, metas, temas, opções do teste) */
.cefr-card,
.goal-card,
.placement-option-card,
.wizard-topic-card,
.manual-lvl-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  color: var(--text-primary);
}

.cefr-card:hover,
.goal-card:hover,
.placement-option-card:hover,
.wizard-topic-card:hover,
.manual-lvl-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.cefr-card.selected,
.goal-card.selected,
.placement-option-card.selected,
.wizard-topic-card.selected,
.manual-lvl-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--shadow-xs);
}

.card-island-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.chip-word-pool,
.chip-word-ordered {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

.chip-word-pool:hover { border-color: var(--primary); background: var(--primary-soft); }

.chip-word-ordered {
  background: var(--primary-soft);
  border-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.example-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  display: inline-block;
}

.grammar-example-bank {
  display: block;
  margin: 0 0 1.5rem;
  text-align: left;
  max-height: 340px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.1rem 0.15rem 0.35rem;
}

.grammar-example-row {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0 0 0.55rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  cursor: pointer;
  text-align: left;
  white-space: normal;
  overflow: hidden;
  box-sizing: border-box;
  line-height: 1.35;
}

.grammar-example-row:last-child { margin-bottom: 0; }

.grammar-example-row.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.grammar-example-fr,
.grammar-example-pt {
  display: block;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}

.grammar-example-fr {
  font-weight: 700;
  color: var(--text-strong);
}

.grammar-example-pt {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Sprint 3.4 — sessão 5 etapas / 25 min */
.grammar-session-progress {
  border-left: 4px solid var(--primary);
}

.grammar-progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border-color);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.grammar-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.grammar-step-rail {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.grammar-step-chip {
  appearance: none;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 110px;
  justify-content: center;
}

.grammar-step-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.grammar-step-chip.is-active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.grammar-step-chip.is-done:not(.is-active) {
  border-color: var(--success);
  color: var(--success);
}

.grammar-step-chip-label {
  white-space: nowrap;
}

.grammar-passage {
  padding: 1.25rem 1.35rem;
  background: var(--bg-surface-hover);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
}

.grammar-passage-fr {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.5;
  font-weight: 700;
  color: var(--text-strong);
}

.grammar-passage-pt {
  margin: 0.4rem 0 0;
  font-size: 0.98rem;
  line-height: 1.45;
  font-weight: 400;
  color: var(--text-muted);
}

.grammar-passage-sentences {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.grammar-passage-item {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg-surface) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.grammar-passage-item:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

.grammar-passage-item.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent);
}

.grammar-passage-item .grammar-passage-fr {
  font-size: 1.12rem;
}

.grammar-passage-item .grammar-passage-pt {
  margin-top: 0.35rem;
}

.grammar-audio-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.grammar-audio-fallback-hint {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.grammar-produce-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.grammar-produce-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  background: var(--bg-surface);
}

.grammar-produce-card.is-accepted {
  border-color: var(--success);
  background: var(--success-light);
}

.grammar-produce-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.grammar-produce-prompt {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.grammar-produce-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.grammar-produce-input {
  width: 100%;
  resize: vertical;
  min-height: 64px;
}

.grammar-levelup-banner {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  padding: 1rem;
}

.grammar-levelup-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

@media (max-width: 640px) {
  .grammar-step-chip-label {
    font-size: 0.72rem;
  }

  .grammar-passage-fr {
    font-size: 1.15rem;
  }

  .grammar-audio-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .grammar-example-fr {
    font-size: 1rem;
  }
}

/* ==============================================================================
   8. Notificações (toasts)
   ============================================================================== */

#toast-container {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 420px;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  animation: slideInToast 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast-icon { font-size: 1rem; line-height: 1; flex-shrink: 0; margin-top: 0.1rem; }
.toast-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.toast-message { line-height: 1.45; }
.toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.toast-action-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2, var(--surface));
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.toast-action-btn.is-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary, #fff);
}
.toast-action-btn:hover { filter: brightness(0.97); }

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--error); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-info { border-left: 3px solid var(--info); }

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

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

/* ==============================================================================
   9. Painel inicial: estatísticas e plano do dia
   ============================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: var(--surface-3);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.15;
}

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

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: var(--space-4) 0;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0.9rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.activity-item:hover {
  border-color: var(--primary-light);
  background: var(--surface);
  transform: translateX(2px);
}

.activity-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.activity-num {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.activity-check-btn {
  background: none;
  border: 1.5px solid var(--border-strong);
  width: 26px;
  height: 26px;
  min-height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.activity-check-btn:hover { border-color: var(--success); background: var(--success-light); }

.activity-title { font-weight: 600; color: var(--text-strong); }
.activity-duration { font-size: 0.82rem; color: var(--text-muted); }

/* ==============================================================================
   10. Shadowing
   ============================================================================== */

.shadow-sentence-container {
  min-height: 120px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem 0.4rem;
  line-height: 1.5;
  padding: var(--space-5) var(--space-4);
}

.shadow-word {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  font-weight: 500;
  color: var(--text-strong);
  padding: 0.15rem 0.5rem 0.35rem;
  border-radius: var(--radius-sm);
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1),
              background 0.22s ease-out, color 0.22s ease-out, box-shadow 0.22s ease-out;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  line-height: 1.25;
}

.shadow-word-text {
  display: block;
}

.shadow-word-phon {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.shadow-word.highlight-word .shadow-word-phon,
.shadow-word.word-problem .shadow-word-phon,
.shadow-word.word-warning .shadow-word-phon,
.shadow-word.word-good .shadow-word-phon {
  color: inherit;
  opacity: 0.85;
}

.shadow-pronunciation {
  margin: -0.5rem 0 1.5rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.01em;
  line-height: 1.45;
}

.shadow-pronunciation-label {
  display: block;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  opacity: 0.75;
}

.shadow-punct {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.15rem 0.1rem;
  user-select: none;
  transition: all 0.22s ease-out;
}

.shadow-word:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-light);
}

.shadow-word.highlight-word {
  background: var(--primary);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  border-color: var(--primary);
}

.shadow-punct.highlight-word { color: var(--primary); }

.shadow-word.word-problem {
  background: var(--error-light);
  color: var(--error) !important;
  border-bottom: 2px solid var(--error);
}

.shadow-word.word-warning {
  background: var(--warning-light);
  color: var(--warning) !important;
  border-bottom: 2px solid var(--warning);
}

.shadow-word.word-good {
  background: var(--success-light);
  color: var(--success) !important;
  border-bottom: 2px solid var(--success);
}

.phoneme-feedback-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-top: var(--space-5);
  text-align: left;
}

.phoneme-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0.8rem 1.05rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--transition-fast);
}

.phoneme-card.attention { border-left: 3px solid var(--error); background: var(--error-light); }
.phoneme-card.improving { border-left: 3px solid var(--warning); background: var(--warning-light); }
.phoneme-card.mastered { border-left: 3px solid var(--success); background: var(--success-light); }

.phoneme-heard {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text-muted);
  background: var(--surface-2, var(--bg-surface-hover));
  border: 1px solid var(--border-color, var(--border));
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.45rem;
}

.btn-help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-help-tip:hover,
.btn-help-tip[aria-expanded="true"] {
  background: var(--primary);
  color: var(--on-primary, #fff);
}

.api-key-howto {
  margin: 0 0 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-3, var(--bg-surface-hover));
  border: 1px solid var(--border-color, var(--border));
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text);
}

.api-key-howto-title {
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  color: var(--primary);
}

.api-key-howto ol {
  margin: 0;
  padding-left: 1.2rem;
}

.api-key-howto li {
  margin-bottom: 0.4rem;
}

.api-key-howto-note {
  margin: 0.65rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.api-key-howto code {
  font-size: 0.8em;
}

.speed-btn {
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.speed-btn:hover { background: var(--surface-3); color: var(--text-strong); }

.speed-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-loop.loop-active {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
  font-weight: 600;
}

.recording-panel {
  padding: var(--space-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.pulse-recording {
  animation: recordingPulse 1.6s infinite alternate ease-in-out !important;
  background: var(--error) !important;
  border-color: var(--error) !important;
  color: #ffffff !important;
}

@keyframes recordingPulse {
  0% { box-shadow: 0 0 0 0 rgba(176, 96, 90, 0.28); }
  100% { box-shadow: 0 0 0 10px rgba(176, 96, 90, 0.02); }
}

/* ==============================================================================
   11. Revisão espaçada (SRS)
   ============================================================================== */

.srs-hub-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.srs-stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.srs-filter-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.srs-filter-chip {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.srs-filter-chip:hover { border-color: var(--border-strong); color: var(--text-strong); }

.srs-filter-chip.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}

.srs-flip-wrapper {
  perspective: 1400px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  min-height: 400px;
}

.srs-flip-card {
  position: relative;
  width: 100%;
  min-height: 400px;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.srs-flip-card.flipped { transform: rotateY(180deg); }

.srs-card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  min-height: 400px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.srs-flip-card:hover .srs-card-face {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
}

.srs-card-front { z-index: 2; transform: rotateY(0deg); }

.srs-card-back {
  transform: rotateY(180deg);
  background: var(--grad-card);
  border-color: var(--primary-light);
}

.srs-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.srs-card-body {
  text-align: center;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-4) 0;
}

.srs-prompt-text {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.75rem);
  font-weight: 500;
  color: var(--text-strong);
  line-height: 1.4;
  margin-bottom: var(--space-4);
}

.srs-target-text {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2rem);
  font-weight: 600;
  color: var(--primary);
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.srs-translation-text {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.srs-explanation-box {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.15rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-align: left;
  max-width: 540px;
  width: 100%;
  margin-top: 0.7rem;
}

.srs-ratings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin-top: var(--space-5);
  width: 100%;
}

.srs-rate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  color: var(--text-primary);
}

.srs-rate-btn .rate-emoji { font-size: 1.25rem; margin-bottom: 0.2rem; }
.srs-rate-btn .rate-label { font-size: 0.82rem; font-weight: 600; }
.srs-rate-btn .rate-interval { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }

.srs-rate-btn:hover { transform: translateY(-2px); }
.srs-rate-btn.btn-rate-again:hover { background: var(--error-light); border-color: var(--error); color: var(--error); }
.srs-rate-btn.btn-rate-hard:hover { background: var(--warning-light); border-color: var(--warning); color: var(--warning); }
.srs-rate-btn.btn-rate-good:hover { background: var(--info-light); border-color: var(--info); color: var(--info); }
.srs-rate-btn.btn-rate-easy:hover { background: var(--success-light); border-color: var(--success); color: var(--success); }

.srs-progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--space-4) 0 var(--space-6);
}

.srs-progress-bar-fill {
  height: 100%;
  background: var(--grad-primary);
  transition: width 0.5s ease;
}

.srs-algo-switcher-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-full);
  width: fit-content;
}

.srs-algo-btn {
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.srs-algo-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.srs-algo-btn:hover:not(.active) { color: var(--text-strong); }

.srs-experiment-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-top: var(--space-6);
}

.srs-experiment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.srs-metric-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.srs-metric-val {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.2rem;
}

.srs-metric-lbl { font-size: 0.76rem; color: var(--text-muted); font-weight: 500; }

.srs-stability-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--secondary-soft);
  border: 1px solid var(--secondary-light);
  color: var(--secondary);
  font-size: 0.76rem;
  font-weight: 600;
}

/* ==============================================================================
   12. Conteúdo autêntico, dicionário e fluxo de estudo
   ============================================================================== */

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.content-grid-hub {
  margin-top: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.content-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.content-hub-section {
  margin-bottom: 2rem;
}

.content-hub-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.content-hub-title {
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
}

.content-hub-sub {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.content-hub-empty {
  padding: 1.25rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.content-hub-empty p { margin: 0 0 0.5rem; }
.content-hub-empty-hint {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.content-hub-continue {
  max-width: 320px;
}

.content-creator-row {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.content-creator-row-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: 200px;
  max-width: 260px;
}

.content-creator-chip {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.content-creator-chip:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.content-creator-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.content-creator-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.content-creator-chip-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.content-creator-chip-text strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content-creator-chip-text small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.content-creator-chip-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.content-shelf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
}

.content-session-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.content-pipeline-badge {
  font-size: 0.72rem;
  font-weight: 700;
}
.content-pipeline-badge.is-ready { color: var(--success); }
.content-pipeline-badge.is-pending { color: var(--text-muted); }
.content-pipeline-badge.is-failed { color: #c0392b; }

.content-pipeline-error {
  font-size: 0.78rem;
  color: #c0392b;
  line-height: 1.35;
  margin: 0.4rem 0 0;
}

.content-card-disabled {
  opacity: 0.78;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.content-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.content-thumb-wrapper {
  position: relative;
  width: 100%;
  height: 172px;
  background: var(--surface-3);
  overflow: hidden;
}

.content-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.content-card:hover .content-thumb-img { transform: scale(1.03); }

.content-source-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.content-duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(36, 49, 44, 0.78);
  color: #ffffff;
}

.content-card-content {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.content-card-title {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.content-card-channel {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.content-relevance-wrapper { margin: 0.7rem 0; }

.content-relevance-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.content-relevance-bar {
  width: 100%;
  height: 5px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.content-relevance-fill {
  height: 100%;
  background: var(--grad-accent);
  border-radius: var(--radius-full);
}

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.vocab-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.vocab-card:hover { border-color: var(--primary-light); transform: translateY(-2px); }

.vocab-word-fr {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vocab-word-pt {
  font-size: 0.92rem;
  color: var(--secondary);
  font-weight: 500;
  margin-top: 0.15rem;
}

.vocab-example-box {
  background: var(--surface-3);
  border-left: 2px solid var(--primary-light);
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0.7rem 0;
  font-family: var(--font-serif);
  font-style: italic;
}

.interactive-word {
  display: inline-block;
  padding: 0 0.12rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.interactive-word:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.interactive-word-saved {
  background: var(--success-light);
  color: var(--success);
  border-bottom: 1.5px solid var(--success);
}

.interactive-word-saved:hover { background: var(--success-light); color: var(--success); }

.interactive-word-marked {
  background: #fff3bf;
  color: #7a5b00;
  border-bottom: 1.5px dashed #e0b000;
}

.interactive-word-marked.interactive-word-saved {
  background: var(--success-light);
  color: var(--success);
  border-bottom: 1.5px solid var(--success);
}

.study-mark-counter {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.study-transcript-box {
  background: var(--bg-surface, var(--surface));
  border: 1px solid var(--border-color, var(--border));
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}

.study-stepper-meta {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.study-notes-optional {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.study-notes-optional summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.study-local-player {
  width: 100%;
  max-width: 420px;
  max-height: 70vh;
  height: auto;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  display: block;
  background: #000;
  border-radius: var(--radius-lg);
  object-fit: contain;
}

.study-ig-fallback {
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: #1a1a1a;
  color: #fff;
  border-radius: var(--radius-lg);
}

.study-ig-fallback-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.study-ig-fallback-text {
  color: #c8c8c8;
  font-size: 0.9rem;
  max-width: 420px;
  margin: 0 auto 1.25rem;
  line-height: 1.5;
}

.study-ig-fallback-hint {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: #888;
}

.word-popup-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.word-popup-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  padding: var(--space-5);
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.22s ease-out;
}

/* Fluxo guiado em 4 passos */
.study-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: var(--space-5) 0 var(--space-6);
  position: relative;
}

.study-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 2;
}

.study-step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.study-step-item.active .study-step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.study-step-item.completed .study-step-num {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.study-step-label { font-size: 0.74rem; font-weight: 600; color: var(--text-muted); }
.study-step-item.active .study-step-label { color: var(--text-strong); }

.study-media-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-3);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-5);
}

.study-media-iframe {
  width: 100%;
  height: 380px;
  border: none;
  display: block;
}

.live-transcript-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem 1rem;
  margin-bottom: var(--space-5);
}

.live-transcript-header {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.7rem;
}

.live-transcript {
  max-height: 280px;
  overflow-y: auto;
  line-height: 1.8;
  font-size: 1.02rem;
  font-family: var(--font-serif);
}

.transcript-cue {
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.transcript-cue.active {
  background: var(--primary-soft);
  outline: 1px solid var(--primary-light);
}

.transcript-word.speaking {
  background: var(--accent-warm-soft);
  color: var(--accent-gold);
  border-radius: 4px;
  padding: 0 0.2rem;
  font-weight: 600;
}

.comprehension-ratings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.comprehension-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

.comprehension-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.comprehension-btn.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--shadow-xs);
}

/* ==============================================================================
   13. Conversação com IA
   ============================================================================== */

.conv-setup-card { padding: var(--space-6); }

.conv-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.conv-theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: var(--space-4) 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

.conv-theme-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
}

.conv-theme-btn.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--shadow-xs);
}

.conv-theme-icon { font-size: 1.6rem; }
.conv-theme-label { font-size: 0.8rem; font-weight: 600; text-align: center; }

.conv-correction-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.conv-correction-tab {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.conv-correction-tab:hover { border-color: var(--border-strong); color: var(--text-strong); }

.conv-correction-tab.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}

.conv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-4);
}

.conv-quota-banner {
  margin: 0 0 var(--space-3);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted, #64748b);
  font-size: 0.875rem;
  line-height: 1.35;
}

.conv-quota-banner--exhausted {
  border-color: color-mix(in srgb, #c2410c 35%, var(--border));
  background: color-mix(in srgb, #c2410c 8%, var(--surface-2));
  color: var(--text, #1e293b);
}

.conv-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.conv-voice-chip,
.conv-quota-chip {
  font-weight: 500;
}

.conv-quota-chip.is-exhausted {
  opacity: 0.9;
}

.conv-voice-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.65rem;
}

.conv-voice-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.conv-voice-tab.active {
  border-color: var(--accent, #2563eb);
  box-shadow: inset 0 0 0 1px var(--accent, #2563eb);
}

.conv-voice-tab.is-disabled,
.conv-voice-tab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.conv-voice-tab-hint {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

.conv-live-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: color-mix(in srgb, var(--primary, #2563eb) 14%, transparent);
  color: var(--text);
  border: 1px solid var(--border);
}

.conv-live-hint {
  text-align: center;
  max-width: 28rem;
  margin: 0 auto 0.75rem;
  color: var(--text-muted, #666);
  font-size: 0.9rem;
}

.conv-voice-status {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
}

.conv-voice-status.is-warn {
  color: #b45309;
}

.conv-stop-speech-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 1rem;
}

.conv-stop-speech-btn[hidden] {
  display: none !important;
}

@media (max-width: 560px) {
  .conv-voice-tabs {
    grid-template-columns: 1fr;
  }
}

.conv-chat-container {
  min-height: 320px;
  max-height: 52vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  scroll-behavior: smooth;
}

.conv-bubble {
  max-width: 82%;
  animation: fadeSlideIn 0.28s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.conv-bubble-user { align-self: flex-end; }
.conv-bubble-assistant { align-self: flex-start; }

.conv-bubble-content {
  padding: 0.8rem 1.05rem;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  line-height: 1.6;
}

.conv-bubble-user .conv-bubble-content {
  background: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: 6px;
}

.conv-bubble-assistant .conv-bubble-content {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
  font-family: var(--font-serif);
}

.conv-corrections-panel {
  margin-top: 0.5rem;
  padding: 0.7rem 0.85rem;
  background: var(--warning-light);
  border: 1px solid var(--accent-gold-light);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.conv-corrections-header {
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--accent-gold);
}

.conv-correction-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.conv-correction-original { color: var(--error); text-decoration: line-through; }
.conv-correction-arrow { color: var(--text-muted); }
.conv-correction-fixed { color: var(--success); font-weight: 600; }

.conv-correction-explanation {
  width: 100%;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.conv-controls-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.conv-status-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  min-height: 1.2em;
}

.conv-mic-btn {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--grad-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: var(--shadow-glow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: visible;
}

.conv-mic-btn:hover { transform: scale(1.04); box-shadow: var(--shadow-lg); }
.conv-mic-btn:active { transform: scale(0.97); }

.conv-mic-icon { position: relative; z-index: 1; line-height: 1; }

.conv-mic-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
}

.conv-mic-btn[data-state="recording"] {
  background: var(--error);
  animation: micPulse 1.6s infinite;
}

.conv-mic-btn[data-state="recording"] .conv-mic-ring {
  border-color: var(--error-light);
  animation: ringExpand 1.6s infinite;
}

.conv-mic-btn[data-state="processing"] {
  background: var(--warning);
  cursor: not-allowed;
  animation: processingPulse 1.4s infinite;
}

.conv-mic-btn[data-state="speaking"] {
  background: var(--success);
  cursor: default;
}

.conv-mic-btn[data-state="speaking"] .conv-mic-ring {
  border-color: var(--success-light);
  animation: speakingWave 1.8s infinite;
}

@keyframes micPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes ringExpand {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes processingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes speakingWave {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 0; }
}

.conv-text-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 1.05rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.conv-text-toggle-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.conv-text-input-wrap { display: flex; gap: 0.5rem; align-items: center; }

.conv-text-input {
  flex: 1;
  padding: 0.6rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.conv-text-input:focus { border-color: var(--primary); box-shadow: var(--shadow-focus); }

.conv-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.conv-stat-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.1;
}

.conv-stat-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.conv-mode-hint { font-size: 0.8rem; color: var(--text-muted); margin: -0.35rem 0 1rem; }

.conv-correction-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-gold-light);
  background: var(--accent-warm-soft);
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.conv-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.conv-metric-card { text-align: center; }

.conv-metric-ring {
  --pct: 0;
  width: 92px;
  height: 92px;
  margin: 0 auto 0.6rem;
  border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--pct) * 1%), var(--surface-3) 0);
  display: grid;
  place-items: center;
}

.conv-metric-ring-good { background: conic-gradient(var(--success) calc(var(--pct) * 1%), var(--surface-3) 0); }
.conv-metric-ring-mid { background: conic-gradient(var(--warning) calc(var(--pct) * 1%), var(--surface-3) 0); }
.conv-metric-ring-low { background: conic-gradient(var(--error) calc(var(--pct) * 1%), var(--surface-3) 0); }

.conv-metric-ring-inner {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-strong);
}

.conv-metric-label { font-weight: 600; font-size: 0.86rem; }
.conv-metric-detail { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }

.conv-result-correction {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.conv-correction-type {
  margin-left: auto;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ==============================================================================
   14. Modais genéricos
   ============================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: var(--space-5);
}

/* ==============================================================================
   Islands — Seções de Ilha Padrão (Curada) vs Minhas Ilhas
   ============================================================================== */

.island-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0 0.6rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.curated-island-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.75rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--primary);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--surface) 100%);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.curated-island-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.curated-island-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.curated-island-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--primary);
}

.curated-island-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.curated-island-card:hover::before {
  opacity: 1;
}

.curated-island-card-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.curated-island-card-icon {
  font-size: 2.25rem;
  flex-shrink: 0;
  line-height: 1;
}

.curated-island-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.2rem 0;
}

.curated-island-card-desc {
  font-size: 0.87rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.curated-island-card-arrow {
  font-size: 1.1rem;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.curated-island-card:hover .curated-island-card-arrow {
  transform: translateX(4px);
}

/* ==============================================================================
   Topic List — Tela "Aprenda o Básico"
   ============================================================================== */

.topic-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.topic-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  position: relative;
}

.topic-card:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateX(3px);
}

.topic-card-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  width: 2.5rem;
  text-align: center;
  line-height: 1;
}

.topic-card-body {
  flex: 1;
  min-width: 0;
}

.topic-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.3rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-card-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.topic-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-glow);
}

.topic-meta-badge.coming-soon {
  background: var(--bg-surface-hover, rgba(0,0,0,0.04));
  color: var(--text-muted);
  border-color: var(--border);
}

.topic-meta-badge.start-here {
  background: rgba(180, 129, 60, 0.14);
  color: var(--accent-gold, #b4813c);
  border-color: rgba(180, 129, 60, 0.35);
  font-weight: 700;
}

.topic-card-start-here {
  border-color: rgba(180, 129, 60, 0.45);
  box-shadow: 0 0 0 1px rgba(180, 129, 60, 0.12);
}

.topic-card-start-here:hover {
  border-color: var(--accent-gold, #b4813c);
}

.topic-card-arrow {
  font-size: 1rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

.topic-card:hover .topic-card-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

/* ==============================================================================
   Subsection Selector — "O que deseja praticar?"
   ============================================================================== */

.subsection-selector {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.subsection-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.subsection-card:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.subsection-card-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.subsection-card-body {
  flex: 1;
}

.subsection-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.1rem 0;
}

.subsection-card-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.subsection-card-arrow {
  font-size: 1rem;
  color: var(--text-muted);
  transition: color 0.15s, transform 0.15s;
}

.subsection-card:hover .subsection-card-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

/* ==============================================================================
   Breadcrumb de Navegação da Ilha
   ============================================================================== */

.island-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.island-breadcrumb a,
.island-breadcrumb button {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.island-breadcrumb a:hover,
.island-breadcrumb button:hover {
  text-decoration: underline;
}

.island-breadcrumb .sep {
  color: var(--border);
}

/* ==============================================================================
   Skeleton Loading — Shimmer
   ============================================================================== */

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton-item {
  height: 68px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    90deg,
    var(--border) 0px,
    var(--surface) 80px,
    var(--border) 160px
  );
  background-size: 600px 100%;
  animation: shimmer 1.4s ease infinite;
}

/* ==============================================================================
   PhraseViewer — Componente de Frases (Islands Sprint 03)
   ============================================================================== */

.phrase-viewer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.phrase-viewer-toolbar,
.phrase-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.phrase-badge-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
}

.phrase-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.phrase-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.phrase-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.phrase-mode-toggle select {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.phrase-mode-toggle select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.phrase-progress-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.phrase-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.phrase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
              background var(--transition-fast), transform var(--transition-fast);
  animation: phraseCardFadeIn 0.35s ease both;
}

@keyframes phraseCardFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.phrase-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.phrase-card.phrase-playing,
.phrase-card.playing {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--shadow-glow);
}

.phrase-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.phrase-card-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.15rem;
  flex-shrink: 0;
}

.phrase-shadow-wrap {
  position: relative;
}

.phrase-shadow-btn {
  flex-shrink: 0;
  min-width: 2.4rem;
  padding: 0.35rem 0.5rem !important;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.72;
}

.phrase-shadow-btn:hover,
.phrase-shadow-btn.is-saved {
  opacity: 1;
}

.phrase-shadow-btn.is-saved {
  color: var(--primary);
}

.phrase-shadow-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 10rem;
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.phrase-shadow-menu-item {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
}

.phrase-shadow-menu-item:hover {
  background: var(--primary-soft);
}

.phrase-card.phrase-in-shadowing {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.shadow-gym-panel {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.shadow-gym-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.shadow-gym-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.shadow-gym-title {
  margin: 0.15rem 0;
  font-size: 1.2rem;
}

.shadow-gym-sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.shadow-gym-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.shadow-reinforce-block {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface, var(--surface));
}

.shadow-reinforce-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.shadow-reinforce-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.shadow-reinforce-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.shadow-reinforce-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  font: inherit;
  color: var(--text-primary);
}

.shadow-reinforce-item:hover {
  border-color: var(--border);
  background: var(--surface);
}

.shadow-reinforce-text {
  flex: 1;
  font-size: 0.9rem;
  font-family: var(--font-serif);
  font-style: italic;
}

.shadow-reinforce-meta {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.shadow-reinforce-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.shadow-ai-block {
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.shadow-ai-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.85rem;
}

.shadow-ai-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.shadow-ai-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
}

.shadow-ai-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.shadow-ai-textarea {
  width: 100%;
  resize: vertical;
  min-height: 4.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface, var(--surface));
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
}

.shadow-ai-profile-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.shadow-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.shadow-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface, var(--surface));
}

.shadow-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.shadow-tab.is-active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border);
}

.shadow-tab-count {
  display: inline-flex;
  min-width: 1.25rem;
  justify-content: center;
  font-size: 0.72rem;
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.shadow-tab-panel {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.shadow-browse-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.shadow-browse-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  font: inherit;
  color: var(--text-primary);
}

.shadow-browse-item:hover {
  border-color: var(--border);
  background: var(--bg-surface, var(--surface));
}

.shadow-browse-text {
  flex: 1;
  font-size: 0.9rem;
  font-family: var(--font-serif);
  font-style: italic;
}

.shadow-browse-meta {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.shadow-lib-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.shadow-lib-chip {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.shadow-lib-chip.is-active {
  color: var(--text-primary, #e8eef5);
  border-color: color-mix(in srgb, var(--primary, #2dd4bf) 55%, transparent);
  background: color-mix(in srgb, var(--primary, #2dd4bf) 16%, transparent);
}

.shadow-browse-more,
.shadow-library-note,
.shadow-library-filters-hint {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.shadow-empty-state {
  text-align: center;
  padding: 1.1rem 0.5rem;
}

.shadow-empty-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.shadow-empty-copy {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.shadow-origin-badge {
  text-transform: none;
  font-weight: 600;
}

.shadow-session-banner {
  margin: -0.5rem 0 1.25rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #e8eef5);
  background: color-mix(in srgb, var(--primary, #2dd4bf) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary, #2dd4bf) 35%, transparent);
}

#shadow-active-player.is-session-active {
  outline: 1px solid color-mix(in srgb, var(--primary, #2dd4bf) 40%, transparent);
}

.shadow-text-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.55rem;
}

.shadow-playback-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.shadow-speed-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.speed-btn-secondary {
  opacity: 0.75;
}

.shadow-sentence-container.is-text-hidden .shadow-sentence-words {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.shadow-sentence-container.is-text-hidden {
  position: relative;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shadow-text-hidden-placeholder {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
}

.shadow-library-filters.is-collapsed {
  display: none;
}

.phrase-card-index {
  flex-shrink: 0;
  min-width: 1.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-top: 0.15rem;
}

.phrase-card-target,
.phrase-card-native-as-main {
  flex: 1;
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--text-strong);
}

.phrase-card-native-as-main {
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 1.05rem;
}

.phrase-audio-btn {
  flex-shrink: 0;
  min-width: 2.4rem;
  padding: 0.35rem 0.5rem !important;
  font-size: 1.05rem;
  line-height: 1;
}

.phrase-audio-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.phrase-reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.65rem;
  padding: 0.25rem 0;
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.phrase-reveal-btn:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.phrase-card-native {
  margin: 0.55rem 0 0;
  padding: 0.65rem 0.8rem;
  background: var(--surface-3, var(--primary-light));
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  border-left-width: 0;
  transition: max-height 0.32s ease, opacity 0.28s ease, padding 0.28s ease,
              margin 0.28s ease, border-width 0.2s ease;
}

.phrase-card-native.revealed {
  max-height: 220px;
  opacity: 1;
  padding: 0.65rem 0.8rem;
  margin-top: 0.55rem;
  border-left-width: 3px;
}

.phrase-card-native-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

/* No modo inverso, o texto revelado é o L2 → tipografia Lora italic */
.phrase-card-native[data-hidden-label="Francês"],
.phrase-card-native[data-hidden-label="Inglês"] {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-strong);
}

.phrase-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.phrase-empty-emoji {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  line-height: 1;
}

.phrase-empty strong {
  color: var(--text-primary);
}

.phrase-session-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.phrase-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 1rem;
}

.phrase-load-more-wrap .btn {
  min-width: 12rem;
}

@media (max-width: 640px) {
  .phrase-viewer-toolbar,
  .phrase-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .phrase-toolbar-actions {
    width: 100%;
  }

  .phrase-toolbar-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .phrase-card-target,
  .phrase-card-native-as-main {
    font-size: 1.02rem;
  }
}

/* ==============================================================================
   DialogViewer & NarrationViewer (Islands Sprint 04)
   ============================================================================== */

.content-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.dialog-list,
.narration-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dialog-list-item,
.narration-list-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  font-family: var(--font-sans);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), background var(--transition-fast),
              transform var(--transition-fast), box-shadow var(--transition-fast);
}

.dialog-list-item:hover,
.narration-list-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}

.content-list-index {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 1.5rem;
}

.content-list-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.98rem;
}

.content-list-meta {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.content-list-arrow {
  flex-shrink: 0;
  color: var(--primary);
  font-weight: 700;
}

.dialog-viewer,
.narration-viewer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dialog-viewer-header,
.narration-viewer-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.dialog-viewer-title,
.narration-viewer-title {
  flex: 1;
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-strong);
  min-width: 10rem;
}

.dialog-viewer-actions,
.narration-viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.dialog-lines {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dialog-line {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  transition: border-color var(--transition-fast), background var(--transition-fast),
              box-shadow var(--transition-fast);
}

.dialog-line.playing {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--shadow-glow);
}

.dialog-line-main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.dialog-line-speaker {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
}

.dialog-line-speaker.a {
  background: var(--secondary-soft);
  color: var(--secondary);
  border: 1px solid var(--secondary-light);
}

.dialog-line-speaker.b {
  background: var(--accent-gold-light);
  color: var(--accent-gold);
  border: 1px solid rgba(180, 129, 60, 0.28);
}

.dialog-line-target {
  flex: 1;
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.45;
  color: var(--text-strong);
  padding-top: 0.15rem;
}

.dialog-line-native {
  margin: 0;
  padding: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  background: var(--surface-3, var(--primary-light));
  border-left: 0 solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.4;
  transition: max-height 0.32s ease, opacity 0.28s ease, padding 0.28s ease,
              margin 0.28s ease, border-width 0.2s ease;
}

.dialog-line.revealed .dialog-line-native,
.dialog-line-native.revealed {
  max-height: 220px;
  opacity: 1;
  padding: 0.6rem 0.8rem;
  margin-top: 0.55rem;
  border-left-width: 3px;
}

.narration-lines {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.25rem 0;
}

.narration-line {
  padding: 0.85rem 0.35rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast), padding var(--transition-fast);
  border-radius: var(--radius-sm);
}

.narration-line:last-child {
  border-bottom: none;
}

.narration-line.playing {
  background: var(--primary-soft);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  box-shadow: inset 3px 0 0 var(--primary);
}

.narration-line-main {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.narration-line-target {
  flex: 1;
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--text-strong);
}

.narration-line-native {
  margin: 0;
  padding: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.4;
  font-style: normal;
  font-family: var(--font-sans);
  transition: max-height 0.32s ease, opacity 0.28s ease, padding 0.28s ease, margin 0.28s ease;
}

.narration-line.revealed .narration-line-native,
.narration-line-native.revealed {
  max-height: 220px;
  opacity: 1;
  padding: 0.45rem 0 0.1rem;
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .dialog-viewer-header,
  .narration-viewer-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dialog-viewer-actions,
  .narration-viewer-actions {
    width: 100%;
  }

  .dialog-viewer-actions .btn,
  .narration-viewer-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .content-list-meta {
    display: none;
  }
}

/* ==============================================================================
   Doação PIX — banner discreto, barra de meta e modal (Sprint 12.9)
   ============================================================================== */

.donation-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin: 0 0 var(--space-5);
  padding: 0.9rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--success) 28%, var(--border));
  border-radius: var(--radius-lg, 12px);
  background: color-mix(in srgb, var(--success) 6%, var(--surface-2));
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.donation-banner--urgent {
  border-color: color-mix(in srgb, var(--warning) 38%, var(--border));
  background: color-mix(in srgb, var(--warning) 8%, var(--surface-2));
}

.donation-banner-icon {
  font-size: 1.3rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.donation-banner-body {
  flex: 1;
  min-width: 0;
}

.donation-banner-title {
  margin: 0 0 0.2rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-strong);
}

.donation-banner-text {
  margin: 0 0 0.7rem;
}

.donation-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.donation-progress {
  margin: 0.55rem 0 0.2rem;
}

.donation-progress-labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.donation-progress-fill {
  background: var(--success);
}

.donation-note {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
}

.donation-modal-backdrop {
  z-index: 1100;
}

/* Modal */
.donation-modal {
  max-width: 520px;
}

.donation-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.donation-modal-title {
  margin: 0.2rem 0 0;
  font-size: 1.25rem;
}

.donation-modal-text {
  font-size: 0.95rem;
  margin-bottom: var(--space-4);
}

.donation-pix-block {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.donation-qr {
  width: 180px;
  max-width: 40%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: #fff;
  padding: 0.4rem;
  flex-shrink: 0;
}

.donation-pix-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.donation-suggested {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
}

/* Card do Perfil */
.donation-context-text {
  font-size: 0.94rem;
  line-height: 1.55;
  margin-bottom: var(--space-4);
}

@media (max-width: 640px) {
  .donation-banner {
    flex-direction: column;
    gap: 0.6rem;
  }

  .donation-banner-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .donation-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .donation-modal {
    max-height: 92vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .donation-pix-block {
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
  }

  .donation-qr {
    width: 200px;
    max-width: 70%;
  }

  .donation-pix-details {
    width: 100%;
  }
}

/* QR legível em tema escuro — fundo branco intencional para leitura pelo app do banco */
[data-theme="dark"] .donation-qr {
  background: #fff;
}

