/* ==========================================================================
   AprendeAI — Design Compacto, Moderno, Funcional e Centrado no Usuário
   Referências de Dimensionamento (Prompt Consolidado):
   - Header: 58px
   - Espaçamento entre cards: 10px (8–12px)
   - Padding interno dos cards: 14px (12–16px)
   - Bordas arredondadas: 10px (8–12px)
   - Botões: 38px de altura no desktop (36–40px) | Mobile touch >= 44px
   - Campos de busca: 38px (38–42px)
   - Área principal: Largura máxima de 1200px
   - Espaçamento entre seções: 14px (12–20px)
   ========================================================================== */

:root {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;

  --emerald: #059669;
  --emerald-hover: #047857;
  --emerald-soft: #ecfdf5;

  --amber: #d97706;
  --amber-soft: #fffbeb;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fef2f2;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;

  --header-height: 58px;
  --max-width: 100%;
  --card-gap: 10px;
  --card-pad: 14px;
  --btn-height: 38px;
  --search-height: 38px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-modal: 0 14px 32px rgba(15, 23, 42, 0.16);
}

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

textarea {
  resize: none;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Acessibilidade: Foco Visível WCAG 2.2 AA */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}
.skip-link:focus {
  top: 8px;
}

.truncate-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   HEADER COMPACTO (58px)
   ========================================================================== */
.app-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-accent {
  color: var(--primary);
}

.header-mic-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 4px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  animation: recPulse 1.2s infinite ease-in-out;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid #fde68a;
  font-size: 0.78rem;
  font-weight: 700;
}

/* ==========================================================================
   BOTÕES E CONTROLES (36–40px Desktop | >=44px Mobile)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--btn-height);
  padding: 0 14px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.08s ease;
  user-select: none;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.btn-sm {
  height: 34px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.btn-xs {
  height: 30px;
  padding: 0 9px;
  font-size: 0.76rem;
}

.btn-lg {
  height: 42px;
  padding: 0 18px;
  font-size: 0.92rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
}

.btn-success {
  background: var(--emerald);
  color: #ffffff;
}
.btn-success:hover:not(:disabled) {
  background: var(--emerald-hover);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: #fecaca;
}
.btn-outline-danger:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: #fca5a5;
}

.btn-ghost-danger {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost-danger:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
}

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

/* ==========================================================================
   BANNER DE RECUPERAÇÃO DE FALHA
   ========================================================================== */
.recovery-banner {
  background: var(--amber-soft);
  border-bottom: 1px solid #fde68a;
  padding: 8px 16px;
}

.recovery-inner {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #92400e;
}

.recovery-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL E TOOLBAR COMPACTA
   ========================================================================== */
.main-container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 14px 20px 32px;
}

.app-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-xs);
}

.toolbar-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.theme-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.view-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.divider-v {
  width: 1px;
  height: 20px;
  background: var(--border-color);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Campo de Busca Rápida (38px) */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 230px;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: var(--search-height);
  padding: 0 28px 0 32px;
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.search-input:focus {
  background: var(--bg-surface);
  border-color: var(--primary);
  outline: none;
}

.search-clear {
  position: absolute;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}
.search-clear:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

/* ==========================================================================
   TELA 1: CARDS COMPACTOS DE TEMAS (Grid Multi-Coluna no Desktop)
   ========================================================================== */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--card-gap);
}

.theme-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--card-pad);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.theme-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.theme-card-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.theme-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.theme-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.theme-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bg-subtle);
}

.theme-q-badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: 6px;
}

.theme-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   TELA 2: CARDS COMPACTOS DE PERGUNTAS (Alta densidade + Reordenação)
   ========================================================================== */
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

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

.question-card.dragging {
  opacity: 0.5;
  background: var(--primary-soft);
  border-color: var(--primary);
}

.question-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.question-num {
  min-width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.question-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.question-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.42;
  word-break: break-word;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.best-time-tag {
  color: var(--emerald);
  font-weight: 600;
}

.question-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.reorder-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 4px;
}

/* ==========================================================================
   TELA 3: SIMULADOR DE TREINAMENTO (PRÉ-TREINO, ATIVO E RESUMO)
   ========================================================================== */
.sim-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

/* 3A: Configuração Pré-Treino */
.sim-setup-card {
  max-width: 100%;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sim-setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sim-badge {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

.sim-setup-theme-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.sim-setup-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.sim-setup-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.sim-config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.sim-config-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-config-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.mt-10 {
  margin-top: 8px;
}

.time-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.preset-chip {
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  transition: all 0.12s ease;
}

.preset-chip small {
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.8;
}

.preset-chip:hover {
  border-color: var(--primary);
  background: var(--bg-subtle);
}

.preset-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.custom-time-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

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

.sim-setup-pref-row {
  padding-top: 4px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.sim-setup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.mic-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1 1 260px;
}

/* 3B: SIMULADOR ATIVO (FOCO TOTAL, SEM DISTRAÇÕES) */
.sim-active-card {
  max-width: 100%;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
}

.sim-active-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-active-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
}

.sim-active-theme {
  font-weight: 700;
  color: var(--text-secondary);
}

.sim-active-progress {
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.sim-progress-track {
  width: 100%;
  height: 5px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}

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

.sim-active-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 12px 6px;
}

.sim-question-prompt {
  font-size: 1.38rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  max-width: 100%;
  letter-spacing: -0.015em;
}

.sim-timer-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sim-timer-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 10px 22px;
  border-radius: var(--radius-md);
  letter-spacing: -0.03em;
}

.sim-timer-display.timer-warning {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #fcd34d;
}

.sim-timer-display.timer-critical {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fca5a5;
}

.sim-ready-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid #c7d2fe;
  font-size: 0.78rem;
  font-weight: 600;
}

.sim-rec-live-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
  font-size: 0.78rem;
  font-weight: 700;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
   --mic-glow: 0;
  box-shadow: 0 0 0 calc(var(--mic-glow) * 6px) rgba(220, 38, 38, 0.14);
}

.sim-rec-live-box.voice-active {
  background: #ecfdf5;
  color: var(--emerald);
  border-color: #6ee7b7;
  box-shadow: 0 0 0 calc(var(--mic-glow) * 7px) rgba(5, 150, 105, 0.16);
}

.sim-rec-badge-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rec-dot-ring {
  position: relative;
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rec-dot-ring::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  transform: scale(calc(1 + var(--mic-glow) * 0.8));
  transition: transform 0.08s ease;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: recPulse 1.1s infinite ease-in-out;
}

.sim-rec-live-box.voice-active .rec-dot {
  background: var(--emerald);
}

@keyframes recPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.audio-waveform {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  height: 22px;
  padding: 0 4px;
}

.wave-bar {
  width: 3px;
  height: 4px;
  min-height: 4px;
  max-height: 22px;
  background: currentColor;
  border-radius: 999px;
  opacity: 0.85;
  transition: height 0.05s ease-out, opacity 0.08s ease;
}

.sim-voice-state {
  font-size: 0.72rem;
  font-weight: 700;
  padding-left: 6px;
  border-left: 1px solid rgba(15, 23, 42, 0.12);
  min-width: 78px;
  text-align: left;
  white-space: nowrap;
}

.sim-error-banner {
  width: 100%;
  background: var(--danger-soft);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sim-error-msg {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--danger);
}

.sim-error-actions {
  display: flex;
  gap: 8px;
}

.sim-active-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bg-subtle);
}

.btn-start-recording,
.btn-already-answered {
  width: 100%;
  max-width: 560px;
  height: 50px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-md);
}

.btn-start-recording {
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.24);
}

.btn-already-answered {
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.22);
}

.key-hint {
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.btn-interrupt {
  height: 32px;
  font-size: 0.78rem;
}

/* 3C: RESUMO COMPACTO DO TREINAMENTO */
.sim-summary-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.status-completed {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.status-interrupted {
  background: var(--amber-soft);
  color: var(--amber);
}

.summary-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.summary-subtitle {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.summary-actions-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
}

.metric-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.text-emerald { color: var(--emerald); }
.text-amber { color: var(--amber); }
.text-indigo { color: var(--primary); }

.section-mini-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.achievements-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.achievement-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-soft);
  border: 1px solid #c7d2fe;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.achievement-badge strong {
  color: var(--primary);
  display: block;
}

.achievement-badge span {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* ==========================================================================
   TELA 4: HISTÓRICO, GRAVAÇÕES E COMPARATIVO DE EVOLUÇÃO
   ========================================================================== */
.evolution-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.evo-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.evo-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-weight: 600;
}

.evo-val {
  font-size: 1.08rem;
  font-weight: 800;
}

.history-subtabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  overflow-x: auto;
}

.subtab-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.subtab-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.attempts-compact-list,
.sessions-compact-list,
.comparison-compact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attempt-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.attempt-info {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.attempt-top-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.attempt-theme-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 1px 7px;
  border-radius: 4px;
}

.attempt-status-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
}

.tag-early {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.tag-timeout {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag-interrupted, .tag-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag-record {
  background: #fef3c7;
  color: #b45309;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
}

.attempt-q-text {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}

.attempt-metrics-line {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.attempt-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-audio-player {
  height: 32px;
  width: 210px;
}

/* ==========================================================================
   ESTADO VAZIO
   ========================================================================== */
.empty-state {
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 28px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.empty-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 420px;
  margin-bottom: 4px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 6px 0 4px;
}

.load-more-wrap .btn {
  min-width: 210px;
}

/* ==========================================================================
   MODAIS COMPACTOS E ACESSÍVEIS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 500;
}

.modal-dialog {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.modal-sm {
  max-width: 390px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 0.96rem;
  font-weight: 700;
}

.modal-close {
  display: none !important;
}

.modal-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bg-subtle);
}

.modal-dialog > .modal-footer {
  padding: 10px 16px 14px;
}

/* Formulários */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

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

.req {
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  transition: border-color 0.12s ease;
}

.form-input,
.form-select {
  height: 38px;
}

.form-input-sm,
.form-select-sm {
  height: 36px;
  width: auto;
}

textarea,
.form-textarea {
  resize: none;
  min-height: 68px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  outline: none;
}

/* Validação de Campos no Local */
.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--danger) !important;
  background-color: #fff9f9;
}

.form-input.is-invalid:focus,
.form-select.is-invalid:focus,
.form-textarea.is-invalid:focus {
  outline: none;
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.field-error-msg {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--danger);
  font-size: 0.77rem;
  font-weight: 500;
  margin-top: 5px;
  line-height: 1.3;
}

.field-error-msg::before {
  content: "⚠";
  font-size: 0.8rem;
  line-height: 1;
}

.field-error-msg.hidden {
  display: none !important;
}

.alert-box {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.confirm-text {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.intensity-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.radio-card:hover {
  background: var(--bg-subtle);
}
.radio-card strong {
  display: block;
  font-size: 0.82rem;
}
.radio-card span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ==========================================================================
   AUTENTICAÇÃO (LOGIN / CADASTRO COMPACTO)
   ========================================================================== */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 100vh;
}

.auth-container {
  width: 100%;
  max-width: 400px;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.auth-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.auth-tab {
  height: 32px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}
.auth-divider span {
  padding: 0 8px;
}

.auth-footer-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
}

/* ==========================================================================
   TOASTS E RECOMPENSAS VISUAIS NÃO-BLOQUEANTES
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast-item {
  background: #0f172a;
  color: #ffffff;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: toastSlideIn 0.18s ease-out;
}

.toast-success { border-left: 4px solid #10b981; }
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-error { border-left: 4px solid #ef4444; }

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

/* ==========================================================================
   LOADER GLOBAL DE SOLICITAÇÃO (BARRA SUPERIOR + INDICADOR FLUTUANTE)
   ========================================================================== */
.global-top-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 1000;
  pointer-events: none;
  overflow: hidden;
}

.global-top-progress.loading {
  background: linear-gradient(90deg, #10b981 0%, #38bdf8 50%, #6366f1 100%);
  background-size: 200% 100%;
  animation: topProgressAnim 1.1s infinite ease-in-out;
  box-shadow: 0 1px 8px rgba(56, 189, 248, 0.6);
}

@keyframes topProgressAnim {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

.global-loader-backdrop {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.global-loader-backdrop.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-14px);
  pointer-events: none;
}

.global-loader-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
}

.global-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spinLoader 0.65s linear infinite;
  flex-shrink: 0;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

.reward-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 950;
  overflow: hidden;
}

.reward-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
}

.reward-particle.shape-ribbon {
  width: 13px;
  height: 6px;
  border-radius: 3px;
}

.reward-particle.shape-diamond {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  transform: rotate(45deg);
}

.reward-burst-ring {
  position: absolute;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  border-radius: 50%;
  border: 3px solid #10b981;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.45);
  pointer-events: none;
  will-change: transform, opacity;
}

.reward-badge-pop {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border: 2px solid #10b981;
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.32), 0 4px 12px rgba(15, 23, 42, 0.35);
  pointer-events: none;
  white-space: nowrap;
  z-index: 960;
  will-change: transform, opacity;
}

.reward-badge-pop.reward-gold {
  background: linear-gradient(135deg, #78350f 0%, #b45309 50%, #d97706 100%);
  border-color: #fde68a;
  box-shadow: 0 14px 36px rgba(245, 158, 11, 0.42), 0 4px 14px rgba(15, 23, 42, 0.35);
}

.reward-badge-pop.reward-victory {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #059669 100%);
  border-color: #a7f3d0;
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.45), 0 4px 14px rgba(15, 23, 42, 0.35);
}

.reward-badge-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.reward-badge-texts {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
  text-align: left;
}

.reward-badge-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.reward-badge-sub {
  font-size: 0.74rem;
  font-weight: 600;
  color: #a7f3d0;
}

.reward-badge-pop.reward-gold .reward-badge-sub {
  color: #fef3c7;
}

.sim-card-reward-flash {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.45), 0 8px 28px rgba(16, 185, 129, 0.22) !important;
  border-color: #10b981 !important;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Respeito total à preferência por movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   RESPONSIVIDADE TOTAL (TABLETS, CELULARES E TELAS COMPACTAS — ZERO OVERFLOW)
   ========================================================================== */

/* Tablets e Telas Intermediárias (até 900px) */
@media (max-width: 900px) {
  .hide-sm {
    display: none !important;
  }

  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .toolbar-title-group {
    width: 100%;
    justify-content: flex-start;
  }

  .toolbar-controls {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .toolbar-controls .search-box {
    flex: 1 1 220px;
    width: auto;
  }

  .themes-grid {
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  }

  .summary-metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  }

  .evolution-strip {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

/* Celulares e Smartphones (até 640px — Alvos de toque >= 44px WCAG 2.2 AA) */
@media (max-width: 640px) {
  .hide-xs {
    display: none !important;
  }

  .app-header {
    height: 56px;
  }

  .header-inner {
    padding: 0 10px;
    gap: 6px;
  }

  .brand-name {
    font-size: 0.96rem;
  }

  .header-mic-badge span:last-child {
    display: none;
  }

  .header-mic-badge {
    padding: 4px;
  }

  .header-actions {
    gap: 4px;
  }

  .main-container {
    padding: 10px 10px calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .toolbar-row {
    padding: 10px 12px;
    gap: 10px;
  }

  .theme-header-info {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .view-title {
    font-size: 0.98rem;
    white-space: normal;
    line-height: 1.25;
  }

  .toolbar-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .toolbar-controls .search-box,
  .toolbar-controls #filterHistoryTheme {
    grid-column: 1 / -1;
    width: 100%;
  }

  /* Quando só há busca + 1 botão (ex: Meus temas), o botão ocupa largura total também */
  #viewThemes .toolbar-controls .btn,
  #viewHistory .toolbar-controls .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .themes-grid {
    grid-template-columns: 1fr;
  }

  /* Alvos de toque confortáveis (>= 44px) */
  .btn,
  .search-input,
  .form-input,
  .form-select,
  .preset-chip,
  .subtab-btn {
    min-height: 44px;
  }

  .btn-icon {
    width: 42px;
    height: 42px;
    min-height: 42px;
  }

  /* Cards de Perguntas empilhados de forma limpa no celular */
  .question-card {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
  }

  .question-actions {
    width: 100%;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--bg-subtle);
  }

  .reorder-group {
    gap: 4px;
  }

  /* Simulador Pré-Treino e Ativo */
  .sim-card {
    padding: 14px 12px;
  }

  .time-presets {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .custom-time-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .custom-time-row .form-input-sm {
    width: 100%;
  }

  .sim-setup-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .mic-notice {
    flex: 1 1 auto;
  }

  .sim-setup-footer .btn-lg {
    width: 100%;
    min-height: 48px;
  }

  .sim-active-card {
    padding: 14px 12px;
    gap: 14px;
  }

  .sim-active-meta {
    flex-wrap: wrap;
    gap: 6px;
  }

  .sim-active-theme {
    max-width: 62%;
  }

  .sim-question-prompt {
    font-size: 1.08rem;
    line-height: 1.4;
  }

  .sim-timer-display {
    font-size: 2.1rem;
    padding: 8px 18px;
  }

  .sim-ready-badge {
    border-radius: var(--radius-md);
    padding: 8px 12px;
    text-align: left;
    line-height: 1.3;
    max-width: 100%;
  }

  .sim-rec-live-box {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: var(--radius-md);
    padding: 8px 12px;
    gap: 8px;
    max-width: 100%;
  }

  .sim-voice-state {
    border-left: none;
    padding-left: 0;
    min-width: auto;
    text-align: center;
  }

  .btn-start-recording,
  .btn-already-answered {
    max-width: 100%;
    min-height: 52px;
    font-size: 1.02rem;
  }

  .btn-interrupt {
    width: 100%;
    min-height: 42px;
  }

  /* Resumo e Histórico em Celulares */
  .summary-header {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-actions-top {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .summary-metrics-grid,
  .evolution-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .attempt-row {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
  }

  .attempt-info {
    flex: 1 1 auto;
  }

  .attempt-controls {
    width: 100%;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--bg-subtle);
  }

  .compact-audio-player {
    width: 100%;
    height: 38px;
    flex: 1 1 100%;
  }

  /* Modais adaptados ao rodapé/centro da tela do celular */
  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-dialog {
    max-width: 100%;
    max-height: calc(100dvh - 20px);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
  }

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

  .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 6px;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .toast-container {
    left: 10px;
    right: 10px;
    bottom: 12px;
  }

  .toast-item {
    width: 100%;
    justify-content: center;
  }
}

/* Telas Ultra-Compactas (ex: 320px a 380px) */
@media (max-width: 380px) {
  .toolbar-controls {
    grid-template-columns: 1fr;
  }

  .summary-actions-top {
    grid-template-columns: 1fr;
  }

  .summary-metrics-grid,
  .evolution-strip {
    grid-template-columns: 1fr;
  }

  .time-presets {
    grid-template-columns: repeat(2, 1fr);
  }

  .streak-pill {
    display: none;
  }
}
