/* ═══════════════════════════════════════════════
   SEMPER CONCURSOS — app.css v2
   Correções:
   ✓ Badge free com cores corretas (era texto branco em fundo claro)
   ✓ Responsivo melhorado para dashboard
   ✓ Transições mais suaves
   ✓ Melhor contraste em vários elementos
   ═══════════════════════════════════════════════ */

:root {
  --bg: #f5f0e8;
  --surface: #fffdf7;
  --surface2: #f0ebe0;
  --border: #ddd5c0;
  --accent: #1a5c3a;
  --accent2: #c4922a;
  --danger: #b83232;
  --success: #1a5c3a;
  --text: #1c1a14;
  --text-muted: #7a7060;
  --text-dim: #b0a898;
  --font: 'DM Sans', sans-serif;
  --serif: 'Fraunces', serif;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Smooth scroll global */
html { scroll-behavior: smooth; }

/* ═══════════════════════════════════════════════════════
   HEADER do app
   ═════════════════════════════════════════════════════════ */
.app-hdr {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .06);
}
.app-hdr__brand {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.01em;
}

/* ── Lado direito do header (sininho + avatar) ── */
.app-hdr__right { display: flex; align-items: center; gap: 10px; }

/* ── Sininho de notificações ── */
.app-hdr__sino {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface2);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.app-hdr__sino:hover, .app-hdr__sino:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 92, 58, .15);
  outline: none;
}
.app-hdr__sino:active { transform: scale(.93); }
.app-hdr__sino-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger, #e23b3b);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.app-hdr__sino-badge[hidden] { display: none; }

/* ── Painel do sininho (dropdown desktop / bottom sheet mobile) ── */
.app-hdr__sino-menu {
  position: fixed;
  top: 62px;
  right: 16px;
  z-index: 50;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .16);
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.app-hdr__sino-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.app-hdr__sino-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.app-hdr__sino-title { font-weight: 700; font-size: 14px; color: var(--text); }
.app-hdr__sino-acoes { display: flex; gap: 6px; }
.app-hdr__sino-ativar,
.app-hdr__sino-limpar {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
}
.app-hdr__sino-limpar { color: var(--text-muted); }
.app-hdr__sino-ativar:hover,
.app-hdr__sino-limpar:hover { border-color: var(--accent); }
.app-hdr__sino-lista { overflow-y: auto; padding: 6px; }
.app-hdr__sino-vazio { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.sino-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  transition: background .12s;
}
.sino-item:hover { background: var(--surface2); }
.sino-item--nova { background: rgba(26, 92, 58, .06); }
.sino-item__titulo { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.sino-item__corpo { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }
.sino-item__corpo--clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sino-item__data { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.sino-item__link {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700;
  color: var(--accent); background: var(--surface2); border-radius: 6px; padding: 1px 6px; vertical-align: middle;
}

/* Detalhe da mensagem (estilo caixa de mensagens) */
.sino-msg { padding: 6px 6px 12px; }
.sino-msg__voltar {
  background: transparent; border: 0; color: var(--accent); font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 6px 4px; margin-bottom: 6px;
}
.sino-msg__titulo { font-size: 15px; font-weight: 800; color: var(--text); padding: 0 6px; }
.sino-msg__data { font-size: 11px; color: var(--text-dim); padding: 2px 6px 10px; }
.sino-msg__corpo { font-size: 14px; line-height: 1.6; color: var(--text); padding: 0 6px 14px; white-space: pre-wrap; }
.sino-msg__cta {
  display: block; width: calc(100% - 12px); margin: 0 6px;
  padding: 12px 16px; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; font-family: var(--font);
  font-size: 14px; font-weight: 700; cursor: pointer; text-align: center;
  box-shadow: 0 6px 16px rgba(26, 92, 58, .18); transition: background .15s, transform .12s;
}
.sino-msg__cta:hover { background: #144d30; }
.sino-msg__cta:active { transform: translateY(1px); }

/* ── Lembrete pra ativar notificações (topo do dashboard) ── */
.notif-lembrete {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 14px 16px;
  border: 1px solid rgba(26, 92, 58, .25); border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(26, 92, 58, .08), rgba(196, 146, 42, .07));
}
.notif-lembrete[hidden] { display: none; }
.notif-lembrete__txt { display: flex; align-items: flex-start; gap: 12px; min-width: 0; flex: 1; }
.notif-lembrete__emoji { font-size: 22px; flex-shrink: 0; }
.notif-lembrete__t { font-weight: 800; font-size: 14px; color: var(--accent); }
.notif-lembrete__s { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; margin-top: 2px; }
.notif-lembrete__acoes { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.notif-lembrete__btn {
  padding: 9px 18px; border: 0; border-radius: 9px; background: var(--accent); color: #fff;
  font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer;
}
.notif-lembrete__btn:hover { background: #144d30; }
.notif-lembrete__x {
  padding: 9px 10px; border: 0; background: transparent; color: var(--text-muted);
  font-family: var(--font); font-size: 12px; cursor: pointer;
}
@media (max-width: 560px) {
  .notif-lembrete__acoes { width: 100%; }
  .notif-lembrete__btn { flex: 1; }
}

@media (max-width: 640px) {
  .app-hdr__sino-menu {
    top: auto; right: 0; bottom: 0; left: 0;
    width: 100%; max-width: 100%; max-height: 80vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(calc(100% + 20px));
    opacity: 1;
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
  }
  .app-hdr__sino-menu.is-open { transform: translateY(0); }
}

/* ── Avatar circular ── */
.app-hdr__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--accent);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.app-hdr__avatar:hover,
.app-hdr__avatar:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 92, 58, .15);
  outline: none;
}
.app-hdr__avatar:active { transform: scale(.93); }
.app-hdr__avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── Overlay escuro (atrás do bottom sheet no mobile) ── */
.app-hdr__overlay {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.app-hdr__overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
/* No desktop o overlay não aparece — só fecha o menu */
@media (min-width: 641px) {
  .app-hdr__overlay { background: transparent; }
}

/* ── Handle de arraste (só mobile) ── */
.app-hdr__handle {
  display: none;
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 6px auto 10px;
  flex-shrink: 0;
}

/* ── Menu / bottom sheet ── */
.app-hdr__menu {
  /* Desktop: dropdown flutuante */
  position: fixed;
  top: 62px;
  right: 16px;
  z-index: 50;
  min-width: 290px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .16);
  padding: 8px 8px 12px;
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.app-hdr__menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.app-hdr__menu-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.app-hdr__menu-avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  overflow: hidden;
  border: 2px solid var(--border);
}
.app-hdr__menu-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.app-hdr__menu-meta { min-width: 0; flex: 1; }
.app-hdr__menu-nome {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-hdr__menu-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-hdr__menu-email:empty { display: none; }
.app-hdr__menu-cargo {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-hdr__menu-cargo:empty { display: none; }
.app-hdr__menu-plano {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px 10px;
}
.app-hdr__menu-validade {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(26, 92, 58, .14);
  border-radius: 10px;
  background: rgba(26, 92, 58, .06);
}
.app-hdr__menu-validade[hidden] { display: none; }
.app-hdr__menu-validade-label {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.app-hdr__menu-validade-data {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
}
.app-hdr__menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .12s ease;
}
.app-hdr__menu-item:hover,
.app-hdr__menu-item:focus-visible {
  background: var(--surface2);
  outline: none;
}
.app-hdr__menu-item-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.app-hdr__menu-item--danger { color: var(--danger); }
.app-hdr__menu-versao {
  padding: 10px 14px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted, #8a8a8a);
  text-align: center;
  letter-spacing: .02em;
}

/* ═══════════════════════════════════════════════════════
   BANNER "Nova versão disponível" (js/app_update.js)
   ═════════════════════════════════════════════════════════ */
.app-update {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 28px);
  padding: 11px 14px 11px 18px;
  background: var(--surface, #15211a);
  color: var(--text, #eafff2);
  border: 1px solid var(--accent, #34d27b);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  animation: appUpdateIn .28s ease;
}
.app-update[hidden] { display: none; }
.app-update__txt { font-size: 14px; font-weight: 600; white-space: nowrap; }
.app-update__btn {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent, #34d27b);
  color: #06140c;
  transition: filter .12s ease;
}
.app-update__btn:hover { filter: brightness(1.08); }
.app-update__btn:disabled { opacity: .7; cursor: default; }
@keyframes appUpdateIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ═══════════════════════════════════════════════════════
   HERO (saudação + CTA primário + 2 atalhos + drawer "mais")
   ═════════════════════════════════════════════════════════ */
.dash-hero {
  display: block;
  margin-bottom: 24px;
}
.dash-hero__welcome { min-width: 0; margin-bottom: 16px; }
.dash-hero__greeting {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: .02em;
}
.dash-hero__name {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin: 2px 0 6px;
}
.dash-hero__name span { color: var(--accent); }
.dash-hero__sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* — botões compatíveis (legado) — */
.dash-hero__titulo {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.dash-hero__titulo span { color: var(--accent); }
.dash-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* — CTA primário + atalhos secundários — */
.dash-hero__cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(26, 92, 58, .22);
  transition: transform .15s ease, box-shadow .2s ease, background .15s ease;
}
.btn-primary:hover {
  background: #144d30;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(26, 92, 58, .28);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary__icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .18);
  border-radius: 50%;
  font-size: 11px;
  padding-left: 1px;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--surface2);
}
.btn-ghost:active { transform: scale(.97); }

/* — Ferramentas de estudo do dashboard —
   2 grupos (Praticar / Revisar & planejar) com 3 tiles cada. Tiles planos
   (icone + titulo), sem caixa-dentro-de-caixa. 3 colunas em todos os tamanhos. */
.dash-tools {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}
.dash-tools__label {
  margin-bottom: 9px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dash-tools__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.dash-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 96px;
  padding: 16px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s, background .15s;
}
.dash-tool:hover,
.dash-tool:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(26, 92, 58, .1);
  transform: translateY(-2px);
  outline: none;
}
.dash-tool:active { transform: translateY(0); }
.dash-tool__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--surface2);
  font-size: 23px;
}
.dash-tool__title { overflow-wrap: anywhere; }
/* Simulados em destaque — produto-ancora */
.dash-tool--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(26, 92, 58, .16);
}
.dash-tool--primary:hover,
.dash-tool--primary:focus-visible {
  border-color: #144d30;
  background: #144d30;
}
.dash-tool--primary .dash-tool__icon {
  background: rgba(255, 255, 255, .16);
}

/* Estudar com IA — grupo premium em destaque na tela inicial */
.dash-tools__group--ia .dash-tools__label {
  color: var(--accent);
}
.dash-tools__spark {
  font-size: 12px;
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, .5));
}
.dash-tool--ia {
  border-color: rgba(26, 92, 58, .28);
  background:
    linear-gradient(180deg, rgba(26, 92, 58, .05), rgba(26, 92, 58, 0) 70%),
    var(--surface);
}
.dash-tool--ia:hover,
.dash-tool--ia:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(26, 92, 58, .14);
}
.dash-tool--ia .dash-tool__icon {
  background: rgba(26, 92, 58, .1);
}

/* Modal tira-dúvidas IA (chat avulso) */
.ia-chat { display: flex; flex-direction: column; }
.ia-chat__head { margin: 0 0 12px; }
.ia-chat__eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
.ia-chat__title {
  margin: 4px 0 0;
  font-family: var(--serif, var(--font));
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.ia-chat__nota {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Seletor de disciplina da mini-aula (transparência: mostra a base) */
.mini-aula-chooser { padding: 4px 2px; }
.mini-aula-chooser__nota {
  margin: 6px 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}
.mini-aula-chooser__nota--dim { margin-top: 12px; font-size: 12px; opacity: .85; }
.mini-aula-chooser__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.mini-aula-chooser__btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.mini-aula-chooser__btn:hover,
.mini-aula-chooser__btn:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(26, 92, 58, .1);
  transform: translateY(-1px);
  outline: none;
}
.mini-aula-chooser__nome { flex: 1; overflow-wrap: anywhere; }
.mini-aula-chooser__pct {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.mini-aula-chooser__btn.is-foco {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(26, 92, 58, .06), rgba(26, 92, 58, 0) 70%), var(--surface);
}
.mini-aula-chooser__tag {
  position: absolute;
  top: -8px;
  right: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Tela Revisar erros (filtro + questões erradas + flashcards) */
.rev-err-stage {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 90px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.rev-err-filtro { margin-bottom: 14px; }
.rev-err-filtro .chip-row { flex-wrap: wrap; }
#rev-err-tabs { margin-bottom: 14px; }
.rev-err-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 10px;
  overflow: hidden;
}
.rev-err-item[open] { border-color: var(--accent); }
.rev-err-item__sum {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
}
.rev-err-item__sum::-webkit-details-marker { display: none; }
.rev-err-item__sum::after {
  content: '▾';
  margin-left: auto;
  color: var(--text-muted);
  transition: transform .15s;
}
.rev-err-item[open] .rev-err-item__sum::after { transform: rotate(180deg); }
.rev-err-item__txt { color: var(--text); overflow-wrap: anywhere; }
.rev-err-item__body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}
.rev-err-item__body .rev-card__enun { margin-top: 12px; }
.rev-err-fc-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
}
.rev-err-fc-cta__num {
  font-family: var(--serif, var(--font));
  font-size: 40px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.rev-err-fc-cta__txt { color: var(--text-muted); font-size: 14px; }
.rev-err-barra { margin-bottom: 12px; display: flex; justify-content: flex-end; }

/* Rodapé do diagnóstico salvo (data + imprimir) */
.dash-ia-rodape {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-ia-print {
  margin-left: auto;
  padding: 6px 12px;
  border: 1.5px solid var(--accent);
  border-radius: 18px;
  background: transparent;
  color: var(--accent);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.dash-ia-print:hover { background: var(--accent); color: #fff; }
/* Footer da mini-aula com vários botões */
.mini-aula__footer { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; }

/* Bizurados (aluno) */
.biz-stage {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 90px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}
.biz-intro {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.biz-grupo { margin-bottom: 20px; }
.biz-grupo__titulo {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.biz-grupo__itens { display: flex; flex-direction: column; gap: 8px; }
.biz-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.biz-item:hover, .biz-item:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(26, 92, 58, .1);
  transform: translateY(-1px);
  outline: none;
}
.biz-item__icone { font-size: 22px; }
.biz-item__txt { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.biz-item__titulo { font-weight: 600; font-size: 15px; }
.biz-item__sub { font-size: 12px; color: var(--text-muted); }
.biz-item__seta { color: var(--text-muted); font-size: 22px; }

.biz-leitor-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.biz-cabecalho {
  border-bottom: 3px solid var(--accent);
  padding-bottom: 12px;
  margin-bottom: 18px;
}
.biz-cabecalho__concurso {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent2, #d4af37);
}
.biz-cabecalho__titulo {
  font-family: var(--serif, var(--font));
  font-size: 24px;
  margin: 4px 0 2px;
  color: var(--accent);
}
.biz-cabecalho__sub { color: var(--text-muted); font-size: 14px; }
/* Conteúdo do bizurado (HTML do admin) — mantém leitura confortável */
.biz-conteudo { font-size: 15px; line-height: 1.6; color: var(--text); }
.biz-conteudo img { max-width: 100%; height: auto; }
.biz-conteudo h2, .biz-conteudo h3 { color: var(--accent); }
.biz-conteudo ul { padding-left: 20px; }
.ia-chat__chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ia-chat__chip {
  padding: 7px 13px;
  border: 1.5px solid var(--accent);
  border-radius: 18px;
  background: rgba(26, 92, 58, .06);
  color: var(--accent);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.ia-chat__chip:hover { background: var(--accent); color: #fff; }
.ia-chat__chip:active { transform: scale(.96); }

.ia-chat__msgs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  max-height: 48vh;
  overflow-y: auto;
  padding: 4px 2px;
  margin-bottom: 12px;
}
.ia-chat__msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ia-chat__msg--bot {
  align-self: flex-start;
  background: var(--surface2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.ia-chat__msg--user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ia-chat__dots { letter-spacing: 2px; opacity: .6; animation: ia-chat-blink 1s steps(3) infinite; }
@keyframes ia-chat-blink { 50% { opacity: .25; } }
.ia-chat__bar { display: flex; gap: 8px; align-items: center; }
.ia-chat__input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
}
.ia-chat__input:focus { outline: none; border-color: var(--accent); }
.ia-chat__send {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.ia-chat__send:hover { background: #144d30; }
.ia-chat__send:active { transform: scale(.94); }

/* ═══════════════════════════════════════════════════════
   CARDS DE STATS + SEÇÕES DO DASHBOARD
   ═════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  padding: 18px 18px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 12px rgba(0, 0, 0, .04);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .05), 0 10px 20px rgba(0, 0, 0, .07);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--text-dim);
  opacity: .5;
}
.stat-card--accent::before  { background: var(--accent); opacity: 1; }
.stat-card--gold::before    { background: var(--accent2); opacity: 1; }
.stat-card--success::before { background: #2a8c58; opacity: 1; }
.stat-card__num {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -.01em;
}
.stat-card--accent  .stat-card__num { color: var(--accent); }
.stat-card--gold    .stat-card__num { color: var(--accent2); }
.stat-card--success .stat-card__num { color: #2a8c58; }
.stat-card__label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 6px;
  font-weight: 600;
}

/* — Card padrão de seção — */
.dash-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 12px rgba(0, 0, 0, .04);
}
.dash-card--featured {
  background: linear-gradient(135deg, var(--surface), var(--surface2));
  box-shadow: 0 4px 16px rgba(26, 92, 58, .12), 0 1px 2px rgba(0, 0, 0, .04);
  border: 1px solid rgba(26, 92, 58, .15);
}

/* — Treino de erradas (modo simples pós-simulado: questão por questão) — */
.alts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-alt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.btn-alt:hover:not(:disabled) {
  background: var(--surface2);
  border-color: var(--accent);
}
.btn-alt:disabled { cursor: default; }
.btn-alt__letra {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-alt__texto { flex: 1; padding-top: 3px; }
.btn-alt.is-marcada {
  background: rgba(26, 92, 58, .08);
  border-color: var(--accent);
}
.btn-alt.is-marcada .btn-alt__letra {
  background: var(--accent);
  color: #fff;
}
.btn-alt.is-correta {
  background: rgba(34, 197, 94, .08);
  border-color: #22c55e;
}
.btn-alt.is-correta .btn-alt__letra {
  background: #22c55e;
  color: #fff;
}
.btn-alt.is-errada {
  background: rgba(239, 68, 68, .08);
  border-color: #ef4444;
}
.btn-alt.is-errada .btn-alt__letra {
  background: #ef4444;
  color: #fff;
}

/* — Próximo Simulado (CTA primário do dashboard) — */
.dash-proximo-sim {
  margin: 0;
  padding: 22px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a5c3a 0%, #2a7a4d 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(26, 92, 58, .25);
  position: relative;
  overflow: hidden;
}
/* Estado vazio: nenhum simulado publicado ainda — visual mais sutil */
.dash-proximo-sim[data-estado="vazio"] {
  background: linear-gradient(135deg, #2c3a32 0%, #3d4b41 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.dash-proximo-sim[data-estado="loading"] {
  opacity: .65;
}
/* Erro de rede / API — laranja avisando, NÃO desvia pro treino */
.dash-proximo-sim[data-estado="erro"] {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  box-shadow: 0 4px 12px rgba(180, 83, 9, .25);
}
.dash-proximo-sim[data-estado="erro"] .dash-proximo-sim__cta {
  color: #b45309;
}
.dash-proximo-sim::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}
.dash-proximo-sim__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
  margin-bottom: 6px;
}
.dash-proximo-sim__titulo {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
}
.dash-proximo-sim__meta {
  font-size: 13px;
  color: rgba(255, 255, 255, .9);
  margin-bottom: 14px;
  line-height: 1.4;
}
.dash-proximo-sim__nota {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, .15);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.dash-proximo-sim__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: #fff;
  color: #1a5c3a;
  border: none;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.dash-proximo-sim__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
}
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

/* — Título de seção (Fraunces, sem uppercase berrante) — */
.dash-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -.005em;
}
.dash-section-title__icon { font-size: 18px; line-height: 1; }
.dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.dash-section-head .dash-section-title { margin-bottom: 0; }
.dash-section-meta {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   TABS INTERNAS (card de Desempenho)
   ═════════════════════════════════════════════════════════ */
.dash-tabs-card { padding: 0; overflow: hidden; }
.dash-tabs-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), transparent);
  overflow-x: auto;
  scrollbar-width: none;
}
.dash-tabs-nav::-webkit-scrollbar { display: none; }
.dash-tabs-tab {
  flex: 0 0 auto;
  padding: 9px 14px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s ease, background .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dash-tabs-tab:hover { color: var(--text); background: var(--surface2); }
.dash-tabs-tab.is-active {
  color: var(--accent);
  background: var(--surface2);
  box-shadow: inset 0 -2px 0 0 var(--accent);
}
.dash-tabs-tab__icon { font-size: 15px; line-height: 1; }
.dash-tabs-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px 0 8px;
  flex: 0 0 auto;
}
.dash-tabs-panels { padding: 18px 20px 20px; }
.dash-tabs-panel { display: none; }
.dash-tabs-panel.is-active { display: block; animation: dashTabIn .22s ease; }
@keyframes dashTabIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
  .dash-tabs-nav { padding: 6px; gap: 2px; }
  .dash-tabs-tab { padding: 8px 11px; font-size: 12px; }
  .dash-tabs-tab__label { display: none; }
  .dash-tabs-tab__icon { font-size: 17px; }
  .dash-tabs-tab.is-active .dash-tabs-tab__label { display: inline; }
  .dash-tabs-panels { padding: 14px 14px 16px; }
  .dash-tabs-actions { padding-right: 4px; }
  .dash-tabs-actions .btn-analisar-ia-text { display: none; }
}

/* ═══════════════════════════════════════════════════════
   BOTÃO GHOST PEQUENO (.btn-quiet)
   Usado em: "← Início", "← Voltar", "← Sair", "Zerar",
   "5 de cada", "👁 Ver Gabarito", etc.
   Modificadores: --pill (radius 20px), --md (padding maior)
   ═════════════════════════════════════════════════════════ */
.btn-quiet {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn-quiet:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-quiet--pill { border-radius: 20px; padding: 5px 13px; }
.btn-quiet--md   { padding: 7px 14px; }
.btn-quiet--gold {
  border-color: var(--accent2);
  color: var(--accent2);
  font-weight: 600;
}
.btn-quiet--gold:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(196, 146, 42, .08);
}
.btn-quiet--accent {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.btn-quiet--accent:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(26, 92, 58, .06);
}

/* Botão "solid" verde compacto (Baixar PDF) */
.btn-solid-accent {
  padding: 7px 16px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  border: 0;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease;
}
.btn-solid-accent:hover { background: #144d30; }

/* Barra do editor de capa do gerador (toggle) */
.editor-bar {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}
.editor-bar.is-open { display: block; }
.editor-bar__inner { max-width: 840px; margin: 0 auto; }

/* ── Modo simulado (aluno): gerador enxuto ──
   Quando #tela-gerador tem .gerador--aluno, esconde os controles de
   admin (Editar Capa, layout, baixar/PDF c-gab, editor de capa) e mostra
   só a barra com 2 toggles. O botão "Imprimir / Salvar PDF" e o "Voltar"
   continuam visíveis. */
.gp-sim-bar { display: none; }
.gerador--aluno #gp-btn-editor,
.gerador--aluno #gp-btn-gab,
.gerador--aluno #gp-btn-pdfgab,
.gerador--aluno #gp-btn-pdf,
.gerador--aluno #gp-btn-print,
.gerador--aluno #gp-editor,
.gerador--aluno .tela-header__crumb { display: none !important; }
.gerador--aluno .gp-sim-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.gp-sim-bar__title { font-weight: 700; font-size: 14px; color: var(--accent); }
.gp-sim-bar__modos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
}
.gp-sim-bar__opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.gp-sim-bar__opt input { cursor: pointer; }
.gp-sim-bar__acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
@media (max-width: 640px) {
  .gerador--aluno .gp-sim-bar { gap: 12px; }
  .gp-sim-bar__acoes { margin-left: 0; width: 100%; }
  .gp-sim-bar__acoes button { flex: 1; }
}

/* Container do preview do gerador */
.gp-preview {
  max-width: 840px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* Color input customizado */
.field-color {
  width: 100%;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg);
  padding: 2px;
  outline: none;
}
.field-color:focus { border-color: var(--accent); }

/* Checkbox + label inline (clicável) */
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 0;
}
.checkbox-inline input[type="checkbox"] { accent-color: var(--accent); }

/* Grid customizado pro editor (cor + 3 checkboxes) */
.gp-options-grid {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 1fr;
  gap: 12px;
  align-items: end;
}
@media (max-width: 640px) {
  .gp-options-grid { grid-template-columns: 1fr 1fr; }
}

/* Crumb e info do header de tela */
.tela-header__crumb {
  font-size: 12px;
  color: var(--text-muted);
}
.tela-header__info {
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════
   ONBOARDING — objetivo manual + foto
   ═════════════════════════════════════════════════════════ */
.onb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 20, .52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: var(--font);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.onb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  max-width: 460px;
  width: 100%;
  max-height: min(90vh, 720px);
  overflow-y: auto;
  box-shadow: 0 18px 54px rgba(28, 26, 20, .28);
  animation: modalIn .22s cubic-bezier(.22, .61, .36, 1);
}
.onb-head {
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(221, 213, 192, .75);
}
.onb-kicker {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 6px;
}
.onb-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}
.onb-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 7px;
  line-height: 1.5;
}
.onb-fields {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}
.onb-secao { margin-bottom: 0; }
.onb-secao--gap22 { margin-bottom: 22px; }
.onb-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.onb-input {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.onb-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(26, 92, 58, .12);
}
.onb-foto-row {
  display: flex;
  gap: 15px;
  align-items: center;
  margin: 0 0 18px;
}
.onb-foto-preview {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  min-width: 72px;
  max-width: 72px;
  min-height: 72px;
  max-height: 72px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--accent);
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 800;
  font-size: 20px;
  font-family: var(--font);
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.onb-foto-preview:hover,
.onb-foto-preview:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 92, 58, .14);
  outline: none;
}
.onb-foto-preview:active {
  transform: scale(.98);
}
.onb-foto-preview img,
.onb-foto-img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  display: block;
  border-radius: 50%;
}
.onb-foto-meta {
  min-width: 0;
  flex: 1;
}
.onb-btn-photo {
  min-height: 38px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.onb-btn-photo:hover {
  border-color: var(--accent);
  background: rgba(26, 92, 58, .12);
}
.onb-help {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}

.onb-erro {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(184, 50, 50, .22);
  border-radius: 10px;
  background: rgba(184, 50, 50, .08);
  display: none;
}
.onb-erro.is-shown { display: block; }

.onb-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.onb-btn-skip {
  min-height: 42px;
  padding: 10px 18px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  transition: border-color .15s ease, color .15s ease;
}
.onb-btn-skip:hover { border-color: var(--accent); color: var(--accent); }
.onb-btn-ok {
  min-height: 42px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font);
  opacity: .5;
  transition: opacity .15s ease, background .15s ease;
}
.onb-btn-ok.is-pronto { opacity: 1; }
.onb-btn-ok.is-pronto:hover { background: #144d30; }
.onb-btn-ok:disabled { cursor: default; }

/* Passo de sucesso do onboarding (trampolim pro 1º simulado) */
.onb-actions--col { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 8px; }
.onb-btn-ok--full {
  width: 100%;
  min-height: 50px;
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(26, 92, 58, .22);
}
.onb-actions--col .onb-btn-skip { width: 100%; }

.onb-saudacao-nome { color: var(--accent); }

@media (max-width: 640px) {
  .onb-overlay {
    align-items: flex-end;
    padding: 12px 10px 0;
  }
  .onb-card {
    max-width: 100%;
    max-height: calc(100dvh - 12px);
    border-radius: 20px 20px 0 0;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .onb-card::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 99px;
    background: var(--border);
    margin: 0 auto 14px;
  }
  .onb-head {
    padding-bottom: 14px;
    margin-bottom: 16px;
  }
  .onb-title { font-size: 20px; }
  .onb-sub { font-size: 13px; }
  .onb-foto-row {
    gap: 13px;
    align-items: center;
    margin-bottom: 16px;
  }
  .onb-foto-preview {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
    min-width: 64px;
    max-width: 64px;
    min-height: 64px;
    max-height: 64px;
    font-size: 18px;
  }
  .onb-input {
    min-height: 45px;
    font-size: 16px;
  }
  .onb-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .onb-btn-skip,
  .onb-btn-ok {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════
   CHAT IA (no simulado) — bolhas de mensagens
   ═════════════════════════════════════════════════════════ */
.chat-ia-msg-row { display: flex; }
.chat-ia-msg-row--user { justify-content: flex-end; }
.chat-ia-bubble {
  padding: 7px 12px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 12px 12px 12px 4px;
  display: inline-block;
}
.chat-ia-bubble--user {
  background: var(--accent);
  color: #fff;
  border-radius: 12px 12px 4px 12px;
  max-width: 85%;
}
.chat-ia-bubble--bot {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  max-width: 90%;
  line-height: 1.6;
}
.chat-ia-bubble--load {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.chat-ia-bubble--err {
  background: #fee2e2;
  color: #dc2626;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 10px;
}

/* ═══════════════════════════════════════════════════════
   REVISÃO PÓS-SIMULADO — questão, alternativas, filtros
   ═════════════════════════════════════════════════════════ */
.rev-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* Filtros pílula da revisão (Todas/Erradas/Acertadas/Puladas) */
.rev-filtro {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  transition: all .15s ease;
}
.rev-filtro:hover { border-color: var(--accent); color: var(--accent); }
.rev-filtro.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Card de questão revisada */
.rev-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 14px;
}
.rev-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.rev-card__head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rev-card__head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rev-card__num {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.rev-card__disc {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(26, 92, 58, .08);
  color: var(--accent);
  border: 1px solid rgba(26, 92, 58, .2);
}
.rev-card__tempo {
  font-size: 12px;
  color: var(--text-dim);
}
.rev-card__status {
  font-size: 12px;
  font-weight: 700;
}
.rev-card__status--ok    { color: var(--success); }
.rev-card__status--erro  { color: var(--danger); }
.rev-card__status--pulou { color: var(--text-muted); }

.rev-card__enun {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 14px;
}
.rev-card__alts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rev-alt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  line-height: 1.5;
  opacity: .55;
}
.rev-alt.is-marcada-correta {
  background: rgba(26, 92, 58, .08);
  border-color: var(--success);
  opacity: 1;
}
.rev-alt.is-marcada-errada {
  background: rgba(184, 50, 50, .06);
  border-color: var(--danger);
  opacity: 1;
}
.rev-alt.is-correta {
  background: rgba(26, 92, 58, .04);
  border-color: rgba(26, 92, 58, .35);
  opacity: 1;
}
.rev-alt__letra {
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.rev-alt.is-marcada-correta .rev-alt__letra,
.rev-alt.is-correta .rev-alt__letra {
  background: var(--success);
  color: #fff;
}
.rev-alt.is-marcada-errada .rev-alt__letra {
  background: var(--danger);
  color: #fff;
}
.rev-alt__txt { color: var(--text); flex: 1; }

.rev-card__explic {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}
.rev-card__explic strong { color: var(--text); }

/* Resultado: card "Tempo total" full-width */
.resultado-item--span { grid-column: 1 / -1; }
.resultado-item--span .num {
  color: var(--text-muted);
  font-size: 22px;
}

/* Tag "🔁 Já respondida" no header da questão */
.tag-respondida {
  background: rgba(201, 168, 76, .12);
  color: #c9a84c;
  border: 1px solid rgba(201, 168, 76, .3);
}

/* ═══════════════════════════════════════════════════════
   PLANEJADOR DE ESTUDOS — onboarding + plano + calendário + lista
   (HTML montado em planejador.js · cor tema #0ea5e9 azul)
   ═════════════════════════════════════════════════════════ */

/* — Paywall block azul — */
.paywall-block--blue .btn-paywall-cta { background: linear-gradient(135deg, #0ea5e9, #0369a1); }

/* Bloco de erro centralizado (planejador) */
.plan-error-block {
  text-align: center;
  padding: 40px 20px;
  color: var(--danger);
  font-size: 14px;
}
.plan-error-block--inline { padding: 0; font-size: 13px; }

/* — Onboarding (criar plano) — */
.plan-onb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  margin-bottom: 14px;
}
.plan-onb-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.plan-onb-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 22px;
}
.plan-onb-step {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

.plan-concursos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.plan-concursos-loading {
  color: var(--text-muted);
  font-size: 13px;
}
.plan-concurso {
  text-align: left;
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.plan-concurso:hover { border-color: #0ea5e9; transform: translateY(-1px); }
.plan-concurso.is-selected {
  border: 2px solid #0ea5e9;
  background: rgba(14, 165, 233, .12);
  padding: 13px;
}
.plan-concurso__emoji  { font-size: 18px; margin-bottom: 4px; }
.plan-concurso__codigo { font-weight: 700; font-size: 14px; }
.plan-concurso__nome   { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.plan-concurso__data   { color: #0ea5e9; font-size: 11px; margin-top: 6px; font-weight: 600; }

.plan-empty-info {
  color: var(--text-muted);
  font-size: 13px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.plan-presets {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.plan-preset-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .15s ease, color .15s ease;
}
.plan-preset-btn:hover { border-color: #0ea5e9; color: #0ea5e9; }

.plan-grid-dias {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.plan-dia-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}
.plan-dia-input {
  width: 100%;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  text-align: center;
  outline: none;
  font-family: var(--font);
  box-sizing: border-box;
  transition: border-color .15s ease;
}
.plan-dia-input:focus { border-color: #0ea5e9; }
.plan-total-horas-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.plan-erro-onb {
  display: none;
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
}
.plan-erro-onb.is-shown { display: block; }
.plan-data-inicio { margin-bottom: 22px; }

/* Botão primary azul (Gerar plano / outros) */
.btn-blue {
  width: 100%;
  padding: 14px;
  background: #0ea5e9;
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease, box-shadow .2s ease;
  box-shadow: 0 4px 14px rgba(14, 165, 233, .22);
}
.btn-blue:hover {
  background: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14, 165, 233, .3);
}
.btn-blue:disabled { opacity: .6; cursor: default; }

/* — Cabeçalho do plano — */
.plan-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 14px;
}
.plan-header__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.plan-header__codigo  { font-size: 22px; margin-bottom: 4px; }
.plan-header__nome    { font-size: 13px; color: var(--text-muted); }
.plan-header__dias    { font-size: 12px; margin-top: 6px; }
.plan-aviso-dias--ok    { color: #0ea5e9; font-weight: 700; }
.plan-aviso-dias--hoje  { color: #ef4444; font-weight: 700; }
.plan-aviso-dias--passou { color: var(--text-muted); }

.plan-edit-data {
  margin-left: 6px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}
.plan-edit-data:hover { color: #0ea5e9; }

.plan-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-header-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .15s ease, color .15s ease;
}
.plan-header-btn:hover { border-color: #0ea5e9; color: #0ea5e9; }
.plan-header-btn--muted { color: var(--text-muted); }

.plan-progress-bar {
  background: var(--surface2);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.plan-progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #0369a1);
  transition: width .3s ease;
}
.plan-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Tabs Calendário/Lista (segmented dentro do header) */
.plan-vista-tabs {
  display: flex;
  gap: 6px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 8px;
  width: fit-content;
}
.plan-vista-tab {
  padding: 6px 12px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s ease, color .15s ease;
}
.plan-vista-tab:hover { color: var(--text); }
.plan-vista-tab.is-active {
  background: #0ea5e9;
  color: #fff;
  font-weight: 600;
}

/* Banner de itens atrasados (acima do calendário/lista) */
.plan-banner-atraso {
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .25);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.plan-banner-atraso__msg { font-size: 13px; color: #ef4444; }
.plan-banner-atraso__btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #ef4444;
  background: transparent;
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s ease;
}
.plan-banner-atraso__btn:hover { background: rgba(239, 68, 68, .08); }

/* — Calendário — */
.plan-cal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
}
.plan-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.plan-cal-nav {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .15s ease, color .15s ease;
}
.plan-cal-nav:hover:not(:disabled) { border-color: #0ea5e9; color: #0ea5e9; }
.plan-cal-nav:disabled { opacity: .35; cursor: not-allowed; }
.plan-cal-mes {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.plan-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 6px;
}
.plan-cal-weekday {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.plan-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
.plan-cal-empty-cell { aspect-ratio: 1; background: transparent; }
.plan-cal-cell {
  aspect-ratio: 1;
  padding: 2px;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  position: relative;
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  transition: border-color .12s ease, background .12s ease;
}
.plan-cal-cell:hover { border-color: #0ea5e9; }
.plan-cal-cell.is-todos    { background: rgba(34, 197, 94, .15); border-color: #22c55e; }
.plan-cal-cell.is-atrasado { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .35); }
.plan-cal-cell.tem-itens   { background: rgba(14, 165, 233, .08); border-color: rgba(14, 165, 233, .35); }
.plan-cal-cell.is-selecionado { border: 2px solid #0ea5e9; padding: 1px; }
.plan-cal-cell__num {
  font-size: 12px;
  font-weight: 500;
}
.plan-cal-cell__num.is-hoje { font-weight: 700; color: #0ea5e9; }
.plan-cal-cell__points {
  display: flex;
  gap: 2px;
  margin-top: auto;
}
.plan-cal-point {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.plan-cal-point--teoria   { background: #0ea5e9; }
.plan-cal-point--revisao  { background: #f59e0b; }
.plan-cal-point--simulado { background: #22c55e; }
.plan-cal-cell__count {
  font-size: 9px;
  color: var(--text-muted);
}
.plan-cal-legenda {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.plan-cal-legenda__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.plan-cal-legenda__dot--teoria   { background: #0ea5e9; }
.plan-cal-legenda__dot--revisao  { background: #f59e0b; }
.plan-cal-legenda__dot--simulado { background: #22c55e; }

/* — Detalhe do dia / Lista — */
.plan-dia-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.plan-dia-card__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
.plan-dia-empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.plan-dia-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 10px;
}

.plan-itens-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Lista por semana */
.plan-semana-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
}
.plan-semana__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

/* — Item de estudo (checkbox + body) — */
.plan-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: border-color .15s ease;
}
.plan-item:last-child { margin-bottom: 0; }
.plan-item.is-feito {
  background: rgba(34, 197, 94, .08);
  border-color: #22c55e;
}
.plan-item.is-atrasado {
  background: rgba(239, 68, 68, .06);
  border-color: rgba(239, 68, 68, .3);
}
.plan-item__check {
  width: 20px;
  height: 20px;
  accent-color: #22c55e;
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}
.plan-item__body { flex: 1; min-width: 0; }
.plan-item__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.plan-item.is-feito .plan-item__title {
  text-decoration: line-through;
  opacity: .6;
}
.plan-item__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.plan-item__nota {
  font-size: 12px;
  color: var(--text);
  background: var(--surface2);
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 6px;
  white-space: pre-wrap;
}
.plan-item__actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.plan-item-btn {
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .15s ease, color .15s ease;
}
.plan-item-btn:hover { border-color: #0ea5e9; color: #0ea5e9; }

/* ═══════════════════════════════════════════════════════
   QUIZ RELÂMPAGO — card amarelo de CTA do dia + modal de quiz
   JS controla display:block/none diretamente do card.
   ═════════════════════════════════════════════════════════ */
.quiz-relampago-card {
  display: none;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border: 0;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
  color: #1f2937;
  box-shadow: 0 6px 18px rgba(245, 158, 11, .25);
}

/* Agente Bravo proativo — o tutor "fala primeiro" no dashboard */
.bravo-proativo {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #1a5c3a, #2a8c58);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  color: #fff;
  box-shadow: 0 6px 18px rgba(26, 92, 58, .22);
}
.bravo-proativo[hidden] { display: none; }
.bravo-proativo__av {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: rgba(255, 255, 255, .16);
  border-radius: 50%;
}
.bravo-proativo__txt { flex: 1; min-width: 0; }
.bravo-proativo__nome {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .7);
}
.bravo-proativo__msg {
  font-size: 14px;
  line-height: 1.45;
  margin-top: 2px;
}
.bravo-proativo__msg strong { color: #ffe08a; }
.bravo-proativo__cta {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  background: #fff;
  color: #1a5c3a;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s, background .15s;
}
.bravo-proativo__cta:hover { background: #ffe08a; transform: translateY(-1px); }
.bravo-proativo__cta:active { transform: translateY(0); }
.bravo-proativo__fechar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .75);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s;
}
.bravo-proativo__fechar:hover { background: rgba(255, 255, 255, .28); color: #fff; }
@media (max-width: 560px) {
  .bravo-proativo { flex-wrap: wrap; }
  .bravo-proativo__cta { width: 100%; justify-content: center; align-self: auto; }
}

/* Conteúdo do card (info hoje ou já feito) */
.qr-card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.qr-card__emoji { font-size: 32px; flex-shrink: 0; }
.qr-card__body  { flex: 1; min-width: 160px; }
.qr-card__eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .8;
}
.qr-card__title  { font-size: 16px; font-weight: 700; margin-top: 2px; }
.qr-card__sub    { font-size: 11px; opacity: .85; margin-top: 2px; }
.qr-card__btn {
  padding: 11px 20px;
  border-radius: 8px;
  border: 0;
  background: #1f2937;
  color: #fbbf24;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
  transition: transform .12s ease, filter .15s ease;
}
.qr-card__btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.qr-card__btn--ghost {
  padding: 9px 16px;
  background: rgba(31, 41, 55, .15);
  color: #1f2937;
  box-shadow: none;
  font-size: 12px;
}

/* Modal — questão */
.qr-q-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.qr-q-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.qr-q-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.qr-bar {
  height: 4px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}
.qr-bar__fill {
  height: 100%;
  background: #f59e0b;
  border-radius: 99px;
  transition: width .3s ease;
}
.qr-q-disc {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.qr-q-enun {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 14px;
  white-space: pre-wrap;
}
.qr-alts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.qr-alt {
  text-align: left;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: border-color .15s ease, background .15s ease;
}
.qr-alt:hover { border-color: #f59e0b; }
.qr-alt.is-selected {
  background: #fef3c7;
  border-color: #f59e0b;
}
.qr-alt__letra { font-weight: 700; color: #f59e0b; flex-shrink: 0; }
.qr-alt__txt   { flex: 1; }

/* Modal — navegação */
.qr-nav {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}
.qr-nav__prev {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.qr-nav__prev:hover { border-color: #f59e0b; color: #f59e0b; }
.qr-nav__next, .qr-nav__final {
  padding: 9px 18px;
  border-radius: 8px;
  border: 0;
  background: #f59e0b;
  color: #1f2937;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s ease;
}
.qr-nav__final { padding: 10px 20px; font-size: 13px; }
.qr-nav__next:hover, .qr-nav__final:hover { filter: brightness(1.05); }
.qr-nav__next:disabled, .qr-nav__final:disabled {
  background: var(--surface2);
  color: var(--text-muted);
  cursor: not-allowed;
  filter: none;
}

/* Modal — resultado */
.qr-result-head {
  text-align: center;
  margin-bottom: 18px;
}
.qr-result__emoji  { font-size: 54px; margin-bottom: 6px; }
.qr-result__titulo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.qr-result__sub {
  font-size: 14px;
  color: var(--text-muted);
}
.qr-result__sub b { color: #f59e0b; }

.qr-xp-card {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  text-align: center;
  color: #1f2937;
}
.qr-xp-card__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .8;
}
.qr-xp-card__num   { font-size: 26px; font-weight: 800; margin-top: 2px; }
.qr-xp-card__bonus { font-size: 11px; font-weight: 700; margin-top: 4px; }

.qr-gab-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.qr-gab-item {
  background: var(--surface2);
  border-left: 3px solid #2a8c58;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.qr-gab-item--erro { border-left-color: #b83232; }
.qr-gab-item__head {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.qr-gab-item__enun {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 6px;
}
.qr-gab-item__resp {
  font-size: 11px;
  color: var(--text-muted);
}
.qr-gab-item__resp b           { color: #2a8c58; }
.qr-gab-item--erro .qr-gab-item__resp b:first-of-type { color: #b83232; }

.qr-result-footer {
  text-align: center;
  margin-top: 18px;
}
.qr-result-footer .modal-info-state__btn { padding: 11px 24px; }

.qr-result-aviso {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 11px;
  color: #78350f;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════
   EMPTY STATES (ícone + microcopy + CTA)
   ═════════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 16px 22px;
  gap: 4px;
}
.empty-state__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface2), rgba(26, 92, 58, .08));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 10px;
  box-shadow: inset 0 0 0 1px rgba(26, 92, 58, .1);
}
.empty-state__title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.empty-state__msg {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 320px;
  margin-bottom: 14px;
}
.empty-state__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 99px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(26, 92, 58, .2);
  transition: transform .15s ease, box-shadow .2s ease, background .15s ease;
}
.empty-state__cta:hover {
  background: #144d30;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(26, 92, 58, .28);
}
.empty-state__cta:active { transform: translateY(0); }
.empty-state--compact { padding: 18px 12px 14px; }
.empty-state--compact .empty-state__icon {
  width: 44px;
  height: 44px;
  font-size: 22px;
  margin-bottom: 8px;
}
.empty-state--compact .empty-state__title { font-size: 14px; }
.empty-state--compact .empty-state__msg   { font-size: 12px; margin-bottom: 10px; }
.dash-tabs-card .empty-state {
  padding-top: 4px;
}
.dash-tabs-card .empty-state__icon {
  display: none;
}

/* ═══════════════════════════════════════════════════════
   SKELETONS (placeholders animados)
   ═════════════════════════════════════════════════════════ */
.skeleton {
  display: block;
  background: linear-gradient(90deg,
    var(--surface2) 0%,
    rgba(0, 0, 0, .04) 50%,
    var(--surface2) 100%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: skeletonShine 1.4s ease-in-out infinite;
}
.skeleton--text  { height: 12px; margin: 8px 0; }
.skeleton--title { height: 16px; width: 60%; margin: 8px 0 12px; }
.skeleton--row   { height: 38px; margin: 8px 0; border-radius: 8px; }
.skeleton--bar   { width: 100%; height: 100px; border-radius: 8px; }
@keyframes skeletonShine {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════
   BOTTOM TAB BAR mobile (≤640px)
   Oculta por padrão; aparece em telas pequenas quando
   body.in-dashboard está ativa. Respeita safe-area (iPhone).
   ═════════════════════════════════════════════════════════ */
.app-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .06);
}
.app-tabs__item {
  flex: 1;
  min-height: 52px;
  background: transparent;
  border: 0;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color .12s ease, background .12s ease;
}
.app-tabs__item:hover,
.app-tabs__item:active,
.app-tabs__item.is-active {
  color: var(--accent);
  background: var(--surface2);
}
.app-tabs__icon { font-size: 20px; line-height: 1; }
.app-tabs__label { letter-spacing: .2px; }

/* ── Variante com FAB central ── */
.app-tabs--with-fab .app-tabs__fab-slot {
  flex: 0 0 64px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}
.app-fab {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  margin-top: -22px;
  box-shadow: 0 6px 16px rgba(26, 92, 58, .35), 0 2px 4px rgba(0, 0, 0, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, box-shadow .2s ease, background .15s ease;
}
.app-fab::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--surface);
  z-index: -1;
}
.app-fab:hover {
  background: #144d30;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 22px rgba(26, 92, 58, .42), 0 2px 4px rgba(0, 0, 0, .08);
}
.app-fab:active { transform: scale(.96); }
.app-fab__icon {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ═══════════════════════════════════════════════════════
   MOBILE (≤640px) — bottom tabs + bottom sheet + dashboard
   ═════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Bottom tab bar ── */
  body.in-dashboard .app-tabs { display: flex; }
  body.in-dashboard #tela-dashboard {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ── Header menor ── */
  .app-hdr {
    padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }
  .app-hdr__brand { font-size: 16px; }

  /* ── Bottom sheet (perfil) ── */
  .app-hdr__handle { display: block; }

  .app-hdr__menu {
    /* Reaproveita posicionamento desktop, sobrescreve pra bottom sheet */
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    min-width: 100% !important;
    max-width: 100% !important;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: 0 !important;
    box-shadow: 0 -6px 32px rgba(0, 0, 0, .22) !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    /* Anima de baixo pra cima — não usa opacity */
    opacity: 1 !important;
    transform: translateY(calc(100% + 20px)) !important;
    transition: transform .32s cubic-bezier(.4, 0, .2, 1) !important;
  }
  .app-hdr__menu.is-open {
    transform: translateY(0) !important;
  }

  /* ── Hero: empilha em coluna, CTA full-width ── */
  .dash-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 18px;
  }
  .dash-hero__name { font-size: 24px; }
  .dash-hero__sub { font-size: 13px; }
  .dash-hero__titulo { font-size: 21px; }
  .dash-hero__cta { width: 100%; }
  .dash-hero__cta .btn-primary {
    flex: 1 1 100%;
    justify-content: center;
    padding: 14px 20px;
  }
  .dash-hero__cta .btn-ghost {
    flex: 1 1 calc(50% - 5px);
    justify-content: center;
  }
  .dash-tools {
    gap: 16px;
    margin-top: 14px;
  }
  .dash-tools__grid {
    gap: 8px;
  }
  .dash-tool {
    min-height: 82px;
    padding: 13px 8px;
    font-size: 12px;
  }
  .dash-tool__icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  /* ── Botões de ação (legado) — carrossel horizontal ── */
  .dash-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    width: calc(100% + 32px);
    margin-left: -16px;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .dash-actions::-webkit-scrollbar { display: none; }
  .dash-actions > * {
    flex-shrink: 0;
    scroll-snap-align: start;
    padding: 12px 20px !important;
    font-size: 13px !important;
    white-space: nowrap;
  }

  /* ── Container principal ── */
  #tela-dashboard > div:not(.app-hdr):not(.app-tabs) {
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: 18px !important;
  }

  /* ── Stats 2×2 ── */
  #dash-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }
  #dash-cards > div { padding: 14px !important; }
  #dash-cards > div > div:first-child { font-size: 22px !important; }

  /* ── Grids: empilham ── */
  #dash-grid-2col,
  #dash-grid-bottom,
  .dash-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  #dash-grid-2col > div,
  #dash-grid-bottom > div { padding: 16px !important; }
  .dash-card { padding: 16px; }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat-card { padding: 14px; }
  .stat-card__num { font-size: 24px; }
}

/* ── CONFIGURAR SIMULADO ── */
#tela-config {
  display: none; min-height: 100vh;
  align-items: flex-start; justify-content: center; padding: 32px 20px 60px;
}
.config-card {
  background: var(--surface); border-radius: var(--radius-xl); padding: 32px 28px;
  max-width: 560px; width: 100%; box-shadow: var(--shadow);
}
.config-title { font-family: var(--serif); font-size: 24px; font-weight: 600; margin-bottom: 4px; }
.config-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.config-section { margin-bottom: 18px; }
.config-label {
  display: block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); margin-bottom: 7px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 13px; border-radius: 99px; font-size: 12px; font-weight: 500;
  border: 1.5px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer; font-family: var(--font);
  transition: all .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.ativo { background: var(--accent); border-color: var(--accent); color: #fff; }
.config-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.config-field { flex: 1; min-width: 0; }
select, .config-input {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface2);
  color: var(--text); font-family: var(--font); font-size: 13px; outline: none;
  transition: border-color .2s; appearance: none;
  /* Seta customizada para selects */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7060' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
select:focus, .config-input:focus { border-color: var(--accent); }
.config-row { display: flex; gap: 12px; margin-bottom: 14px; }
.config-row .config-field { flex: 1; }
.config-resumo {
  padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface2);
  font-size: 12px; color: var(--text-muted); margin-bottom: 16px;
  min-height: 36px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
}
.resumo-tag {
  background: rgba(26,92,58,.1); color: var(--accent);
  border: 1px solid rgba(26,92,58,.2); border-radius: 4px;
  padding: 1px 7px; font-size: 11px; font-weight: 600;
}
.resumo-extra { margin-left: 6px; color: var(--text-muted); }
.resumo-empty { color: var(--text-muted); }

/* Empty state da lista de disciplinas no montador */
.mt-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}
.btn-iniciar {
  width: 100%; padding: 14px; border-radius: 10px; border: none;
  background: var(--accent); color: #fff; font-family: var(--font);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s;
  box-shadow: 0 4px 16px rgba(26,92,58,.2);
}
.btn-iniciar:hover { background: #144d30; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,92,58,.3); }
@media(max-width:520px){ .config-row { flex-direction: column; gap: 8px; } }

/* ── SIMULADO ── */
#tela-simulado { display: none; }

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}
.header-left { display: flex; align-items: center; gap: 16px; }
.logo-text { font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--accent); }
.progress-wrap { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 300px; margin: 0 24px; }
.progress-bar { flex: 1; height: 5px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.4s ease; }
.progress-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-weight: 500; }
.main { max-width: 780px; margin: 0 auto; padding: 36px 24px; }

/* META */
.question-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tag { padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.tag-ano     { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.tag-cargo   { background: rgba(26,92,58,0.08); color: var(--accent); border: 1px solid rgba(26,92,58,0.2); }
.tag-oficial { background: rgba(196,146,42,.1); color: #c4922a; border: 1px solid rgba(196,146,42,.25); font-weight: 600; }
.tag-inedita { background: rgba(99,102,241,.1); color: #818cf8; border: 1px solid rgba(99,102,241,.25); font-weight: 600; }
.tag-img     { background: rgba(196,146,42,0.1); color: var(--accent2); border: 1px solid rgba(196,146,42,0.3); }
/* Modalidade Certo/Errado — laranja pra avisar o aluno que ele só vai
   ver 2 alternativas (afirmação Certo ou Errado). */
.tag-ce      { background: rgba(249,115,22,.1); color: #f97316; border: 1px solid rgba(249,115,22,.3); font-weight: 600; }

/* QUESTÃO */
.question-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); margin-bottom: 16px; }
.question-number {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.question-id-ref {
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid rgba(107, 114, 128, .18);
  background: rgba(107, 114, 128, .06);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.question-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 28px;
  font-weight: 400;
  text-align: justify;
  hyphens: auto;
  word-wrap: break-word;
}
.question-text p { margin: 0 0 0.9em 0; }
.question-text p:last-child { margin-bottom: 0; }
.question-text strong, .question-text b { font-weight: 700; }
.question-text em, .question-text i { font-style: italic; }
.question-text u { text-decoration: underline; }
.question-text blockquote {
  margin: 0.9em 0;
  padding: 4px 14px;
  border-left: 3px solid var(--accent, #1a5c3a);
  color: var(--text-muted, #6b7280);
  font-style: italic;
}
.question-text ul,
.question-text ol { margin: 0.6em 0 0.9em 1.5em; padding: 0; }
.question-text li { margin: 0.2em 0; }
.question-text h3 { font-size: 18px; margin: 0.8em 0 0.4em; font-weight: 700; }
.question-text h4 { font-size: 16px; margin: 0.8em 0 0.4em; font-weight: 700; }
.question-text a { color: var(--accent, #1a5c3a); text-decoration: underline; }

/* Texto de apoio (texto-base compartilhado entre questões — ex: Português interpretação) */
.texto-apoio-box {
  margin: 0 0 24px;
  padding: 18px 22px;
  background: linear-gradient(180deg, rgba(201,168,76,.06), rgba(201,168,76,.02));
  border: 1px solid rgba(201,168,76,.28);
  border-left: 4px solid #c9a84c;
  border-radius: var(--radius-sm);
  max-height: 340px;
  overflow-y: auto;
}
.texto-apoio-titulo {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #c9a84c;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(201,168,76,.3);
}
.texto-apoio-conteudo {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text);
  word-wrap: break-word;
  max-width: 68ch;
  text-align: justify;
  hyphens: auto;
}
.texto-apoio-conteudo p { margin: 0 0 0.9em 0; text-indent: 1.5em; }
.texto-apoio-conteudo p:first-child { text-indent: 0; }
.texto-apoio-conteudo p:last-child { margin-bottom: 0; }
.texto-apoio-conteudo blockquote {
  margin: 0.9em 0;
  padding: 4px 14px;
  border-left: 3px solid var(--accent, #1a5c3a);
  color: var(--text-muted, #6b7280);
  font-style: italic;
}
.texto-apoio-conteudo ul,
.texto-apoio-conteudo ol { margin: 0.6em 0 0.9em 1.5em; padding: 0; }
.texto-apoio-conteudo li { margin: 0.2em 0; }
.texto-apoio-conteudo a { color: var(--accent, #1a5c3a); text-decoration: underline; }
.texto-apoio-box::-webkit-scrollbar { width: 8px; }
.texto-apoio-box::-webkit-scrollbar-track { background: transparent; }
.texto-apoio-box::-webkit-scrollbar-thumb { background: rgba(201,168,76,.3); border-radius: 4px; }
.texto-apoio-box::-webkit-scrollbar-thumb:hover { background: rgba(201,168,76,.5); }

@media(max-width:640px){
  .texto-apoio-box {
    padding: 14px 16px 16px;
    max-height: none;
    overflow: visible;
    margin: 0 0 20px;
  }
  .texto-apoio-conteudo {
    font-size: 15px;
    line-height: 1.7;
    text-align: left;
    hyphens: none;
    max-width: none;
  }
  .texto-apoio-conteudo p { text-indent: 0; margin: 0 0 0.8em 0; }
  .texto-apoio-conteudo.is-collapsed {
    max-height: 200px;
    overflow: hidden;
    position: relative;
  }
  .texto-apoio-conteudo.is-collapsed::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 70px;
    background: linear-gradient(180deg, rgba(255,253,247,0), rgba(255,253,247,.98) 80%);
    pointer-events: none;
  }
  .texto-apoio-toggle {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(201,168,76,.12);
    border: 1px solid rgba(201,168,76,.35);
    color: #b08a2a;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .texto-apoio-toggle:active { background: rgba(201,168,76,.22); }
}
.question-image { width: 100%; max-height: 320px; object-fit: contain; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 20px; background: var(--surface2); }
.img-placeholder { background: var(--surface2); border: 1.5px dashed var(--border); border-radius: var(--radius-sm); padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

/* ALTERNATIVAS */
.alternatives { display: flex; flex-direction: column; gap: 10px; }
.alt-btn {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px;
  border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg);
  color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.6;
  cursor: pointer; text-align: left; transition: all 0.18s;
}
.alt-btn:hover:not(:disabled) { border-color: var(--accent); background: rgba(26,92,58,0.04); transform: translateX(4px); }
.alt-btn:disabled { cursor: default; transform: none; }
.alt-btn.selected { border-color: var(--accent2); background: rgba(196,146,42,0.06); }
.alt-btn.correct  { border-color: var(--success) !important; background: rgba(26,92,58,0.08) !important; }
.alt-btn.wrong    { border-color: var(--danger) !important; background: rgba(184,50,50,0.06) !important; }
.alt-btn.revealed { opacity: 0.6; }
.alt-letter {
  min-width: 28px; height: 28px; border-radius: 7px; background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: var(--text-muted); transition: all 0.2s; flex-shrink: 0;
}
.alt-btn.correct  .alt-letter { background: var(--success); color: #fff; }
.alt-btn.wrong    .alt-letter { background: var(--danger);  color: #fff; }
.alt-btn.selected .alt-letter { background: var(--accent2); color: #fff; }

/* FEEDBACK */
.feedback-box { border-radius: var(--radius-md); padding: 20px 24px; display: none; margin-bottom: 4px; animation: slideIn 0.3s ease; }
.feedback-box.show { display: block; }
.feedback-box.correct-fb { background: rgba(26,92,58,0.07);  border: 1px solid rgba(26,92,58,0.2); }
.feedback-box.wrong-fb   { background: rgba(184,50,50,0.06); border: 1px solid rgba(184,50,50,0.18); }
.feedback-header { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.feedback-body { font-size: 14px; line-height: 1.75; color: var(--text-muted); }
.feedback-body strong { color: var(--text); }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* AÇÕES */
.action-row { display: flex; gap: 12px; margin-top: 16px; }
.btn-confirm { flex: 1; padding: 13px; border-radius: 10px; border: none; background: var(--accent); color: #fff; font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-confirm:hover:not(:disabled) { background: #144d30; }
.btn-confirm:disabled { opacity: 0.3; cursor: default; }
.btn-next { padding: 13px 24px; border-radius: 10px; border: 1.5px solid var(--border); background: transparent; color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: none; }
.btn-next:hover { border-color: var(--accent); color: var(--accent); }
.btn-next.visible { display: block; }
.btn-pular { padding: 13px 18px; border-radius: 10px; border: 1.5px solid var(--border); background: transparent; color: var(--text-muted); font-family: var(--font); font-size: 13px; cursor: pointer; transition: all 0.2s; }
.btn-pular:hover { border-color: var(--accent2); color: var(--accent2); }
.btn-voltar:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-voltar:disabled { opacity: .4; cursor: default; }
@media (max-width: 520px) {
  .action-row { flex-wrap: wrap; }
  .btn-voltar, .btn-pular { flex: 1 1 calc(50% - 6px); padding: 11px 14px; }
}

/* ── RESULTADO ── */
.resultado-card { background: var(--surface); border-radius: var(--radius-xl); padding: 48px; max-width: 560px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.resultado-emoji { font-size: 56px; margin-bottom: 16px; }
.resultado-titulo { font-family: var(--serif); font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.resultado-sub { font-size: 15px; color: var(--text-muted); margin-bottom: 32px; }
.resultado-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 32px; }
.resultado-item { background: var(--surface2); border-radius: var(--radius-md); padding: 16px 12px; }
.resultado-item .num { font-family: var(--serif); font-size: 28px; font-weight: 700; }
.resultado-item .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px; }
.resultado-item.verde    .num { color: var(--success); }
.resultado-item.vermelho .num { color: var(--danger); }
.resultado-item.dourado  .num { color: var(--accent2); }
.btn-reiniciar { width: 100%; padding: 14px; border-radius: 10px; border: none; background: var(--accent); color: #fff; font-family: var(--font); font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s; margin-bottom: 10px; }
.btn-reiniciar:hover { background: #144d30; }
.btn-reiniciar--gold { background: var(--accent2); margin-bottom: 8px; }
.btn-reiniciar--gold:hover { background: #a87a1f; }
.sim-real-nav {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}
.sim-real-nav__slot {
  display: flex;
}
.sim-real-nav__slot:nth-child(1) { justify-content: flex-start; }
.sim-real-nav__slot:nth-child(2) { justify-content: center; }
.sim-real-nav__slot:nth-child(3) { justify-content: flex-end; }
.sim-real-nav__btn {
  min-width: 140px;
}
#sim-real-nav .btn-reiniciar,
#sim-real-nav .btn-quiet {
  margin-bottom: 0;
  width: 100%;
}
.resultado-stats { width: 100%; max-width: 520px; margin-bottom: 16px; }
.btn-novo { width: 100%; padding: 12px; border-radius: 10px; border: 1.5px solid var(--border); background: transparent; color: var(--text-muted); font-family: var(--font); font-size: 14px; cursor: pointer; transition: all .2s; }
.btn-novo:hover { border-color: var(--accent); color: var(--accent); }

/* LOADING */
.loading-overlay { position: fixed; inset: 0; background: rgba(245,240,232,0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 200; backdrop-filter: blur(4px); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* TIMER */
.timer-warning { color: var(--danger) !important; animation: timerPulse 0.8s ease infinite; }
@keyframes timerPulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── BADGE FREE (CORRIGIDO) ── */
/* Antes usava cores de texto branco que ficavam invisíveis no tema claro */
#_free-badge {
  display: none;
  background: rgba(26,92,58,.08);
  border: 1px solid rgba(26,92,58,.2);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 16px;
  line-height: 1.6;
}
#_free-badge strong { color: var(--accent); }
#_free-badge a { color: var(--accent) !important; }

/* ── DASHBOARD HEADER MELHORADO ── */
#tela-dashboard > div:first-child {
  transition: box-shadow .3s;
}

/* ── RESPONSIVO ── */
@media(max-width:640px) {
  #dash-grid-2col, #dash-grid-bottom { grid-template-columns: 1fr !important; }
  .config-row { flex-direction: column; gap: 0; }
  header { padding: 14px 16px; }
  .main { padding: 24px 16px; }
  .question-card { padding: 24px 20px; }
  .question-text {
    text-align: left;
    hyphens: none;
    font-size: 15.5px;
    line-height: 1.7;
    margin-bottom: 22px;
  }
  .resultado-card { padding: 28px 20px; }
  .resultado-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .resultado-item .num { font-size: 22px; }
  .resultado-item .label { font-size: 10px; }
  .sim-real-nav {
    grid-template-columns: 1fr;
  }
  .sim-real-nav__slot {
    justify-content: stretch !important;
  }
  .sim-real-nav__btn {
    min-width: 0;
  }
  .progress-wrap { max-width: 140px; margin: 0 8px; }
  #timerDisplay { font-size: 15px !important; min-width: 46px !important; }

  /* Dashboard botões empilham verticalmente em telas pequenas */
  #tela-dashboard [style*="display:flex"][style*="gap:10px"] {
    flex-direction: column;
  }
}

/* Tablet */
@media(min-width:641px) and (max-width:860px) {
  #dash-grid-2col { grid-template-columns: 1fr !important; }
}

/* ── Botões do dashboard responsivos ── */
.dash-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-actions button {
  white-space: nowrap;
  min-width: 0;
}
@media(max-width:520px) {
  .dash-actions {
    flex-direction: column;
    width: 100%;
  }
  .dash-actions button {
    width: 100% !important;
    justify-content: center;
  }
}

/* ── Cards de estatística — melhoria mobile ── */
@media(max-width:400px) {
  #dash-cards {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ── Gerador de provas header responsivo ── */
@media(max-width:640px) {
  #tela-gerador > div:first-child {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start !important;
  }
  #tela-gerador > div:first-child > div:last-child {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ── Flashcard responsivo ── */
@media(max-width:520px) {
  #fc-card {
    min-height: 260px !important;
    padding: 20px !important;
  }
}

/* ── Loading overlay melhoria ── */
.loading-overlay {
  gap: 8px;
}

/* ── Melhorias gerais ── */
/* Seleção de texto */
::selection {
  background: rgba(26, 92, 58, 0.2);
  color: var(--text);
}

/* Scrollbar customizada */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--surface2);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ── Acessibilidade: foco visível ── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Animação suave para troca de telas (slide leve) ── */
#tela-dashboard,
#tela-config,
#tela-simulado,
#tela-resultado,
#tela-revisao,
#tela-montador,
#tela-gerador,
#tela-flashcard {
  animation: pageSlide .26s cubic-bezier(.22, .61, .36, 1);
}
@keyframes pageSlide {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #tela-dashboard,
  #tela-config,
  #tela-simulado,
  #tela-resultado,
  #tela-revisao,
  #tela-montador,
  #tela-gerador,
  #tela-flashcard {
    animation: fadeIn .15s ease;
  }
}

/* ═══════════════════════════════════════════════════════
   UTILITÁRIOS DE LAYOUT (telas + containers + headers)
   Reduzem strings de inline style repetidas dezenas de vezes.
   ═════════════════════════════════════════════════════════ */

/* ── Wrapper de tela (display:none por padrão; JS troca pra block) ── */
.tela {
  display: none;
  min-height: 100vh;
  background: var(--bg);
  padding: 0;
}
.tela--column  { flex-direction: column; }
.tela--center  { align-items: center; justify-content: center; padding: 32px; }

/* ── Container central da tela (760px padrão, --wide = 860px) ── */
.tela-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.tela-container--wide { max-width: 860px; padding: 28px 20px 48px; }
.tela-container--narrow { max-width: 560px; padding: 32px 20px 60px; }

/* ── Header sticky de tela secundária (montador, gerador, etc) ── */
.tela-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 8px rgba(0, 0, 0, .06);
  flex-wrap: wrap;
}
.tela-header__title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.005em;
}
.tela-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
@media (max-width: 640px) {
  .tela-header { padding: 12px 16px; }
}

/* ── Eyebrow (label uppercase pequeno antes de um título) ── */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
  display: block;
}
.eyebrow--xs {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: .1em;
}
.eyebrow--inline { display: inline-block; margin-bottom: 0; }

/* ── Inputs e labels de formulário (compactos) ── */
.field-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 600;
}
.field-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color .15s ease;
  box-sizing: border-box;
}
.field-input:focus { border-color: var(--accent); }

/* ── Texto auxiliar pequeno (subtítulo de seção) ── */
.dash-help {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

/* ── Botão outline (cor accent, fundo transparente, full-width) ── */
.btn-outline-accent {
  width: 100%;
  padding: 11px 16px;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background .15s ease;
}
.btn-outline-accent:hover { background: rgba(26, 92, 58, .06); }
.btn-outline-accent:disabled { opacity: .6; cursor: default; }

/* ── Variante "soft" do btn-iniciar (cinza, secundário) ── */
.btn-iniciar--soft {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.btn-iniciar--soft:hover {
  background: var(--surface2);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}

/* ── CTA row: 2 botões lado a lado, empilham no mobile ── */
.cta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cta-row__btn { flex: 1 1 200px; }

/* ── Card variante para resumo-IA — espaço no topo ── */
.resumo-ia-card { margin-bottom: 14px; padding: 18px; }

/* ── Form em card vertical (montador: dados da prova) ── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

/* ── Grid de tabela do montador (Disciplina | Disponível | Qtd) ── */
.mt-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}
.mt-table-head {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 3fr 80px;
  gap: 12px;
  align-items: center;
}
.mt-table-head .eyebrow--xs { margin-bottom: 0; }
.mt-table-head .eyebrow--xs:last-child { text-align: center; }
.mt-table-body { max-height: 340px; overflow-y: auto; }

/* ── Card "Composição" do montador ── */
.mt-comp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}
.mt-comp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mt-comp-total {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}
.mt-comp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
}
.mt-comp-list:empty::before,
.mt-comp-list .mt-comp-empty {
  color: var(--text-dim);
  font-size: 13px;
}

/* ── Botão "iniciar" GRANDE (primary cheio com sombra) ── */
.btn-iniciar-grande {
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .15s ease;
  box-shadow: 0 4px 16px rgba(26, 92, 58, .3);
}
.btn-iniciar-grande:hover {
  background: #144d30;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(26, 92, 58, .35);
}

/* ── Linha de chips inline (banca/tipo/cargo/ano no montador) ── */
.chip-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Texto pré-formatado em containers de prosa ── */
.prose-pre {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

/* ── Segmented tabs (montador, etc) ── */
.seg-tabs {
  display: inline-flex;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 28px;
  width: fit-content;
}
.seg-tab {
  padding: 10px 24px;
  border: 0;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-muted);
  transition: background .15s ease, color .15s ease;
}
.seg-tab.is-active { background: var(--accent); color: #fff; }
.seg-tab:not(.is-active):hover { color: var(--text); }

/* ── Linhas/grids genéricos pra forms compactos ── */
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .row-2 { grid-template-columns: 1fr; }
}
.flex-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.flex-row--between { justify-content: space-between; }
.flex-row--end     { justify-content: flex-end; }

/* ═══════════════════════════════════════════════════════
   FLASHCARDS (tela-flashcard) — sessão de revisão
   ═════════════════════════════════════════════════════════ */
.fc-progresso {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}
.fc-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  gap: 16px;
}
.fc-bar {
  width: 100%;
  max-width: 560px;
  height: 4px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.fc-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width .4s ease;
}
.fc-card {
  width: 100%;
  max-width: 560px;
  min-height: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 16px;
  user-select: none;
  position: relative;
  transition: transform .15s ease, box-shadow .2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.fc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}
.fc-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.fc-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fc-front {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  flex: 1;
  font-weight: 500;
}
.fc-back {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fc-back[hidden] { display: none; }
.fc-explicacao {
  padding: 14px 16px;
  background: rgba(26, 92, 58, .1);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-line;
}
.fc-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.fc-rate-row {
  display: flex;
  width: 100%;
  max-width: 560px;
  gap: 10px;
}
.fc-rate-row[hidden] { display: none; }
.fc-rate-btn {
  flex: 1;
  padding: 14px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease;
  border: 1.5px solid;
}
.fc-rate-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.fc-rate-btn--wrong {
  background: rgba(184, 50, 50, .15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, .3);
}
.fc-rate-btn--right {
  background: rgba(26, 92, 58, .15);
  color: var(--accent);
  border-color: rgba(74, 222, 128, .3);
}

.fc-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  gap: 16px;
  text-align: center;
}
.fc-result[hidden] { display: none; }
.fc-result__emoji { font-size: 52px; }
.fc-result__title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.fc-result__sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}
.fc-result__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

/* — Abas do ranking (Esta semana / Geral) — */
.rank-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.rank-tab {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.rank-tab:hover { border-color: var(--accent); color: var(--accent); }
.rank-tab.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Badge do plano no menu de perfil (gratuito / VIP) */
.plano-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid;
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  font-family: var(--font);
}
.plano-badge--gratuito {
  background: rgba(120, 120, 120, .12);
  color: #888;
  border-color: rgba(120, 120, 120, .25);
}

/* — VIP: badge MAIOR e destacada — */
.plano-badge--vip,
.plano-badge--anual {
  font-size: 14px;
  padding: 7px 18px;
  gap: 7px;
  letter-spacing: .5px;
  background: linear-gradient(135deg, #d4a72c 0%, #f5d068 50%, #d4a72c 100%);
  background-size: 200% 100%;
  color: #4a3a0e;
  border: 1px solid rgba(212, 167, 44, .55);
  box-shadow:
    0 2px 8px rgba(212, 167, 44, .35),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
  animation: vipShimmer 3.5s linear infinite;
  position: relative;
}
.plano-badge--anual {
  background: linear-gradient(135deg, #1a5c3a 0%, #2a7a4d 50%, #1a5c3a 100%);
  background-size: 200% 100%;
  color: #fff;
  border-color: rgba(26, 92, 58, .55);
  box-shadow:
    0 2px 8px rgba(26, 92, 58, .35),
    inset 0 1px 0 rgba(255, 255, 255, .25);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .15);
}
@keyframes vipShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.plano-badge__expira {
  font-size: 10px;
  opacity: .8;
  font-weight: 600;
}

/* Mobile: não diminui — VIP é status, manter destaque */
@media (max-width: 640px) {
  .plano-badge--vip,
  .plano-badge--anual {
    font-size: 13px;
    padding: 6px 16px;
  }
}

/* ── Tema premium: coroa inline ao lado do nome ── */
.vip-coroa-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  padding: 4px 10px 4px 8px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font);
  letter-spacing: .8px;
  background: linear-gradient(135deg, #d4a72c 0%, #f5d068 50%, #d4a72c 100%);
  background-size: 200% 100%;
  color: #3d2f08;
  border: 1px solid rgba(212, 167, 44, .55);
  box-shadow:
    0 2px 8px rgba(212, 167, 44, .4),
    inset 0 1px 0 rgba(255, 255, 255, .45);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .3);
  animation: vipShimmer 3.5s linear infinite;
  vertical-align: middle;
  position: relative;
  top: -3px;
}
.vip-coroa-inline[hidden] {
  display: none;
}
.vip-coroa-inline__txt {
  font-size: 11px;
}
@media (max-width: 480px) {
  .vip-coroa-inline { font-size: 12px; padding: 3px 8px 3px 6px; margin-left: 6px; }
  .vip-coroa-inline__txt { font-size: 10px; }
}

/* Sub do hero quando VIP — texto dourado em vez de cinza */
.dash-hero__sub-vip {
  display: inline-block;
  color: #b88a18;
  font-weight: 600;
  letter-spacing: .2px;
}

/* ── Card "Próximo Simulado" com tratamento VIP: borda dourada + glow ── */
body.is-vip .dash-proximo-sim[data-estado="pronto"],
body.is-trial .dash-proximo-sim[data-estado="pronto"] {
  border: 1.5px solid rgba(245, 208, 104, .55);
  box-shadow:
    0 4px 18px rgba(26, 92, 58, .25),
    0 0 0 4px rgba(245, 208, 104, .08),
    0 0 32px rgba(212, 167, 44, .12);
  position: relative;
}
/* Brilho sutil correndo na borda — efeito "card especial" */
body.is-vip .dash-proximo-sim[data-estado="pronto"]::after,
body.is-trial .dash-proximo-sim[data-estado="pronto"]::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  padding: 1.5px;
  background: linear-gradient(135deg,
    rgba(245, 208, 104, .55) 0%,
    rgba(245, 208, 104, 0) 25%,
    rgba(245, 208, 104, 0) 75%,
    rgba(245, 208, 104, .55) 100%);
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: vipShimmer 5s linear infinite;
  pointer-events: none;
}

/* Link "Assinar VIP" verde do free-badge */
.link-assinar-vip {
  color: #00e87a;
  text-decoration: none;
  font-weight: 600;
}
.link-assinar-vip:hover { text-decoration: underline; }

/* Sub-info no toast de cadastro com sucesso */
.cadastro-ok-sub {
  font-size: 12px;
  opacity: .7;
}

/* Link "Renovar assinatura" no erro de plano expirado */
.link-renovar {
  color: #4ade80;
  font-weight: 600;
}

/* Sub-textos do resultado de flashcards (verde/dourado, aviso) */
.fc-result-pct--ok   { color: var(--accent); }
.fc-result-pct--warn { color: #f59e0b; }
.fc-result-aviso {
  font-size: 13px;
  margin-top: 6px;
  display: block;
}
.fc-result-aviso--ok { color: var(--accent); }

/* ═══════════════════════════════════════════════════════
   SEÇÃO NUMERADA (1. Banca / 2. Tema / 3. Redação) — redação
   ═════════════════════════════════════════════════════════ */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 14px;
}
.section-card[hidden] { display: none; }
.section-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.section-card__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.section-card__meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Textarea grande pra editor de redação / temas */
.field-textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: var(--font);
  resize: vertical;
  line-height: 1.7;
  min-height: 280px;
  box-sizing: border-box;
  transition: border-color .15s ease;
}
.field-textarea:focus { border-color: var(--accent); }
.field-textarea--small {
  font-size: 13px;
  line-height: 1.5;
  min-height: 0;
  padding: 11px 14px;
}

/* Input "form-md" com padding 11/14 (banca, tema input) */
.field-input--md {
  padding: 11px 14px;
  font-size: 14px;
}

/* Mensagem de erro inline (em form) */
.form-error {
  display: none;
  background: rgba(239, 68, 68, .1);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #ef4444;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 12px;
}
.form-error.is-shown { display: block; }

/* Botão sugerir IA (sub-action no header da seção) */
.btn-suggest-ia {
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid #8b5cf6;
  background: rgba(139, 92, 246, .1);
  color: #8b5cf6;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  transition: background .15s ease;
}
.btn-suggest-ia:hover { background: rgba(139, 92, 246, .18); }

/* Paywall block (tela cheia) */
.paywall-block {
  display: none;
  text-align: center;
  padding: 40px 20px;
}
.paywall-block.is-shown { display: block; }
.paywall-block__icon { font-size: 48px; margin-bottom: 16px; }
.paywall-block__title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.paywall-block__msg {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.6;
}
.btn-paywall-cta {
  padding: 14px 32px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s ease, transform .12s ease;
}
.btn-paywall-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════
   DASHBOARD — gráficos, diagnóstico, disciplinas, histórico, ranking
   (HTML montado em dashboard.js)
   ═════════════════════════════════════════════════════════ */

/* — Gráfico de barras vertical (Evolução) — */
.dash-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dash-bar-pct {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
}
.dash-bar {
  width: 100%;
  max-width: 32px;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height .4s ease;
}
.dash-bar--ok    { background: var(--accent); }
.dash-bar--warn  { background: var(--accent2); }
.dash-bar--bad   { background: var(--danger); }

/* — Diagnóstico (linhas com emoji + nome + bar) — */
.diag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.diag-row__emoji { font-size: 13px; }
.diag-row__body  { flex: 1; min-width: 0; }
.diag-row__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}
.diag-row__name {
  font-size: 11px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.diag-row__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.diag-row__pct {
  font-size: 11px;
  font-weight: 700;
}
.diag-row__pct--ok   { color: #2a8c58; }
.diag-row__pct--warn { color: #c4922a; }
.diag-row__pct--bad  { color: #b83232; }
.diag-row__bar {
  height: 5px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.diag-row__bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}
.diag-row__bar-fill--ok   { background: #2a8c58; }
.diag-row__bar-fill--warn { background: #c4922a; }
.diag-row__bar-fill--bad  { background: #b83232; }

/* Botão "📖 Mini-aula" gradient verde (ao lado do %) */
.btn-mini-aula {
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 0;
  background: linear-gradient(135deg, #1a5c3a, #2a8c58);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
  transition: filter .15s ease;
}
.btn-mini-aula:hover { filter: brightness(1.1); }

/* — Card de disciplina (Questões respondidas por disciplina) — */
.disc-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.disc-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.disc-card__name {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.disc-card__pct {
  font-size: 12px;
  font-weight: 700;
}
.disc-card__pct--ok   { color: #2a8c58; }
.disc-card__pct--warn { color: #c4922a; }
.disc-card__pct--bad  { color: #b83232; }
.disc-card__bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.disc-card__bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.disc-card__bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .4s ease;
}
.disc-card__meta {
  font-size: 11px;
  color: var(--text-muted);
}
.disc-card__meta-num         { color: var(--accent); font-weight: 600; }
.disc-card__meta-acertos--ok   { color: #2a8c58; font-weight: 600; }
.disc-card__meta-acertos--warn { color: #c4922a; font-weight: 600; }
.disc-card__meta-acertos--bad  { color: #b83232; font-weight: 600; }
.disc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

/* — Linha do histórico (data + acertos + %) — */
.hist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.hist-row:last-child { border-bottom: 0; }
.hist-row__data {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}
.hist-row__sub {
  font-size: 11px;
  color: var(--text-muted);
}
.hist-row__pct {
  font-size: 14px;
  font-weight: 700;
}
.hist-row__pct--ok   { color: #2a8c58; }
.hist-row__pct--warn { color: #c4922a; }
.hist-row__pct--bad  { color: #b83232; }

/* — Ranking (medalha + avatar + nome + pontos) — */
.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.rank-row:last-child { border-bottom: 0; }
.rank-row.is-eu {
  background: rgba(26, 92, 58, .06);
  border-radius: 6px;
  padding: 7px 8px;
  margin: 0 -8px;
}
.rank-row__medal {
  font-size: 14px;
  min-width: 24px;
  text-align: center;
}
.rank-row__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
}
.rank-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rank-row__info { flex: 1; }
.rank-row__name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.rank-row.is-eu .rank-row__name { font-weight: 700; color: var(--accent); }
.rank-row__meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}
.rank-row__pct {
  font-size: 13px;
  font-weight: 700;
}
.rank-row__pct--ok   { color: #2a8c58; }
.rank-row__pct--warn { color: #c4922a; }
.rank-row__pct--bad  { color: #b83232; }

/* — Tabelas do _stats no resultado (Desempenho por disciplina + Últimos) — */
.stats-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 12px;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
}
.stats-table tr.head { border-bottom: 1px solid var(--border); }
.stats-table th {
  padding: 6px 10px;
  text-align: left;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
}
.stats-table th.center { text-align: center; }
.stats-table td {
  padding: 8px 10px;
  font-size: 13px;
}
.stats-table td.muted    { color: var(--text-muted); }
.stats-table td.text     { color: var(--text); }
.stats-table td.center   { text-align: center; }
.stats-table td.pct      { font-weight: 700; }
.stats-table td.pct--ok   { color: #2a8c58; }
.stats-table td.pct--warn { color: #c4922a; }
.stats-table td.pct--bad  { color: #b83232; }
.stats-table td.empty    { padding: 10px; color: var(--text-dim); text-align: center; }
.stats-table--small td { padding: 7px 10px; font-size: 12px; }

/* — Estado de info dentro de modal (mini-aula limite, erro) — */
.modal-info-state {
  text-align: center;
  padding: 24px 8px;
}
.modal-info-state__emoji { font-size: 42px; margin-bottom: 10px; }
.modal-info-state__title {
  font-size: 15px;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 6px;
}
.modal-info-state__msg {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.modal-info-state__btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.modal-info-state__btn:hover { background: #144d30; }

/* — Mini-aula IA (conteúdo do modal) — */
.mini-aula__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.mini-aula__eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.mini-aula__banca {
  font-size: 10px;
  color: var(--text-muted);
}
.mini-aula__disciplina {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.mini-aula__title {
  font-size: 18px;
  color: var(--text);
  margin: 0 0 14px;
  line-height: 1.3;
}
.mini-aula__texto {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  margin-bottom: 16px;
}
.mini-aula__bloco {
  background: var(--surface2);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-left: 3px solid var(--accent);
}
.mini-aula__bloco--dicas       { border-left-color: #2a8c58; }
.mini-aula__bloco--pegadinhas  { border-left-color: #c4922a; }
.mini-aula__bloco--exemplo     { border-left-color: var(--accent); margin-bottom: 16px; }
.mini-aula__bloco-title {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.mini-aula__bloco--dicas      .mini-aula__bloco-title { color: #2a8c58; }
.mini-aula__bloco--pegadinhas .mini-aula__bloco-title { color: #c4922a; }
.mini-aula__bloco--exemplo    .mini-aula__bloco-title { color: var(--accent); }
.mini-aula__bloco-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
}
.mini-aula__bloco-list li { margin-bottom: 4px; }
.mini-aula__bloco--pegadinhas .mini-aula__bloco-list li { margin-bottom: 6px; }
.mini-aula__exemplo-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}
.mini-aula__footer { text-align: right; }
.mini-aula__btn-fechar {
  padding: 10px 20px;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.mini-aula__btn-fechar:hover { background: #144d30; }

/* ═══════════════════════════════════════════════════════
   GAMIFICAÇÃO — widget no dashboard + tela de conquistas + toasts
   ═════════════════════════════════════════════════════════ */

/* — Widget no dashboard (#_gam-widget é .dash-card no HTML) — */
.gam-widget__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.gam-widget__nivel {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #2a8c58);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(26, 92, 58, .3);
}
.gam-widget__info {
  flex: 1;
  min-width: 0;
}
.gam-widget__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.gam-widget__xp {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.gam-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.gam-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #4ade80);
  border-radius: 99px;
  transition: width .5s ease;
}
.gam-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.gam-stat-card {
  flex: 1;
  min-width: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  font-family: var(--font);
  transition: border-color .15s ease, transform .12s ease;
}
.gam-stat-card--btn {
  cursor: pointer;
}
.gam-stat-card--btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.gam-stat-card__num {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.gam-stat-card__num--gold { color: var(--accent2); }
.gam-stat-card__label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.gam-stat-card__icon { font-size: 18px; }

/* — Tela de conquistas (lista por categoria + grid de badges) — */
.conq-grupo { margin-bottom: 24px; }
.conq-grupo__title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
}
.conq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.conq-badge {
  background: var(--surface);
  border: 1px solid rgba(26, 92, 58, .3);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  transition: transform .12s ease, box-shadow .15s ease;
}
.conq-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}
.conq-badge--locked {
  border-color: var(--border);
  opacity: .45;
  filter: grayscale(.6);
}
.conq-badge__icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.conq-badge__nome {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.conq-badge__desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
.conq-badge__data {
  margin-top: 8px;
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
}
.conq-badge__locked-tag {
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-dim);
}

/* — Toasts de conquista/nível/streak (fixos top-right) — */
.gam-toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  pointer-events: none;
}
.gam-toast {
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
  pointer-events: auto;
  border: 1px solid;
  animation: _gamSlideIn .4s ease;
}
.gam-toast.is-out { animation: _gamSlideOut .3s ease forwards; }
.gam-toast--conquista { background: rgba(26, 92, 58, .95);  border-color: #4ade80; }
.gam-toast--nivel     { background: rgba(196, 146, 42, .95); border-color: #f59e0b; }
.gam-toast--streak    { background: rgba(239, 68, 68, .95);  border-color: #ef4444; }
.gam-toast__body { flex: 1; min-width: 0; }
.gam-toast__title {
  font-family: var(--serif), Fraunces, serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.gam-toast__msg {
  font-size: 12px;
  color: rgba(255, 255, 255, .75);
  line-height: 1.4;
}
@keyframes _gamSlideIn {
  from { opacity: 0; transform: translateX(100px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes _gamSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100px); }
}

/* ═══════════════════════════════════════════════════════
   BANCO DE FLASHCARDS (tela-banco-flashcards) — SM-2 / Anki-like
   Tema roxo (#8b5cf6) pra diferenciar da tela "flashcards" verde.
   ═════════════════════════════════════════════════════════ */
.tela-header__title--purple { color: #8b5cf6; }
.tela-header__title--pink   { color: #ec4899; }
.tela-header__title--blue   { color: #0ea5e9; }
.tela-header__title--cyan   { color: #06b6d4; }

/* Loading block centralizado pra listas (planejador, simulados) */
.loading-block {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.loading-block--erro { color: var(--danger); padding: 40px 20px; }

/* — Filtros da tela de Simulados (Banca / Status / Cargo / Busca) — */
/* Chips de filtro (status/cargo). Antes reusavam .mid-tag-btn da Midia;
   com a remocao de Podcasts/Materiais, ganharam estilo proprio. */
.sim-reais-tag {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sim-reais-tag:hover { border-color: var(--accent); color: var(--accent); }
.sim-reais-tag.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.sim-reais-tag__count { opacity: .6; margin-left: 2px; }

.sim-reais-filtros {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
/* Guards do atributo [hidden] — sem eles o display:flex/grid sobrescreve o
   hidden e os filtros/contador vazam pra tela de seleção de concurso. */
.sim-reais-filtros[hidden],
.sim-reais-filtros__grupo[hidden],
.sim-reais-contador[hidden] { display: none !important; }
.sim-reais-filtros__busca {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s ease;
}
.sim-reais-filtros__busca:focus { border-color: var(--accent); }
.sim-reais-filtros__grupo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sim-reais-filtros__rotulo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  min-width: 52px;
}
.sim-reais-filtros .chip-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.sim-reais-contador {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.sim-reais-voltar-grupos {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: 700 12px var(--font);
  padding: 7px 12px;
}
.sim-reais-voltar-grupos:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.sim-reais-grupos-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 12px;
}
.sim-reais-grupos-head__title {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}
.sim-reais-grupos-head__sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 3px;
}
.sim-reais-grid {
  display: grid;
  /* auto-fill (não auto-fit): com 1 concurso só, o auto-fit colapsava as
     colunas vazias e o card único esticava a tela inteira (card gigante). */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.sim-reais-grupo-card {
  appearance: none;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 292px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.sim-reais-grupo-card * { pointer-events: none; }
.sim-reais-grupo-card:hover,
.sim-reais-grupo-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
  outline: none;
  transform: translateY(-2px);
}
.sim-reais-grupo-card__top,
.sim-reais-grupo-card__stats,
.sim-reais-grupo-card__meta,
.sim-reais-grupo-card__footer {
  margin-left: 16px;
  margin-right: 16px;
}
.sim-reais-grupo-card__cover {
  background-color: var(--surface2);
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid var(--border);
  display: block;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 120px;
  width: 100%;
}
.sim-reais-grupo-card__cover img {
  display: block;
  height: 100%;
  min-height: 120px;
  object-fit: cover;
  width: 100%;
}
.sim-reais-grupo-card__cover-fallback {
  align-items: flex-end;
  background:
    linear-gradient(135deg, rgba(20, 83, 45, .95), rgba(15, 118, 110, .82) 56%, rgba(202, 138, 4, .9)),
    linear-gradient(90deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0));
  color: #fff;
  display: none;
  font-size: 18px;
  font-weight: 900;
  inset: 0;
  line-height: 1.15;
  overflow-wrap: anywhere;
  padding: 16px;
  position: absolute;
}
.sim-reais-grupo-card__cover.is-error img {
  display: none;
}
.sim-reais-grupo-card__cover.is-error .sim-reais-grupo-card__cover-fallback {
  display: flex;
}
.sim-reais-grupo-card__cover--auto {
  align-items: flex-end;
  background:
    linear-gradient(135deg, rgba(20, 83, 45, .95), rgba(15, 118, 110, .82) 56%, rgba(202, 138, 4, .9)),
    linear-gradient(90deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0));
  color: #fff;
  display: flex;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
  padding: 16px;
}
.sim-reais-grupo-card__cover--auto span {
  display: block;
  max-width: 86%;
  overflow-wrap: anywhere;
}
.sim-reais-grupo-card__top,
.sim-reais-grupo-card__stats {
  display: flex;
  gap: 8px;
}
.sim-reais-grupo-card__top {
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 3px;
}
.sim-reais-grupo-card__eyebrow {
  color: var(--text-muted);
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.sim-reais-grupo-card__title {
  color: var(--text);
  display: block;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.sim-reais-grupo-card__count {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  min-width: 28px;
  padding: 0 9px;
}
.sim-reais-grupo-card__meta {
  color: var(--text-muted);
  display: block;
  font-size: 13px;
  line-height: 1.4;
  min-height: 36px;
}
.sim-reais-grupo-card__stats {
  align-items: center;
  flex-wrap: wrap;
}
.sim-reais-grupo-card__stats span,
.sim-reais-grupo-card__pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
}
.sim-reais-grupo-card__pill--gold {
  background: #fef3c7;
  border-color: #facc15;
  color: #92400e;
}
.sim-reais-grupo-card__footer {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  margin-top: auto;
  margin-bottom: 16px;
}
.sim-real-card {
  margin-bottom: 14px;
  overflow: hidden;
  padding: 0;
}
.sim-real-card__cover {
  aspect-ratio: 16 / 9;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  width: 100%;
}
.sim-real-card__cover img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.sim-real-card__body {
  padding: 18px;
}

/* Tela de conquistas */
.conquistas-xp {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent2);
}
.conquistas-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.banco-progresso {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
  font-weight: 700;
}
.banco-progresso--sub { font-weight: normal; font-size: 11px; }

/* Tela inicial de seleção de filtros */
.banco-selecao {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  gap: 20px;
}
.banco-selecao__inner {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.banco-selecao__title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.banco-selecao__sub {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
.banco-selecao__atalhos {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* Filtros lado a lado */
.banco-filtros {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.banco-filtros__field { flex: 1; min-width: 180px; }
.banco-filtros__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  display: block;
  margin-bottom: 6px;
}
.banco-filtros__select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease;
}
.banco-filtros__select:focus { border-color: #8b5cf6; }

.banco-contador {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.banco-contador__empty { color: var(--text-muted); }
.banco-contador-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
  margin: 8px 0;
}
.banco-contador__num {
  font-size: 22px;
  font-weight: 800;
}
.banco-contador__num--novos      { color: #3b82f6; }
.banco-contador__num--aprendendo { color: #f59e0b; }
.banco-contador__num--revisao    { color: #8b5cf6; }
.banco-contador__num--maduros    { color: var(--accent); }
.banco-contador__label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.banco-contador__total {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

/* Tag/pill genérica do banco (usada em _bancoTag) */
.banco-pill {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  display: inline-block;
}
.banco-pill--neutra     { border-color: var(--border); color: var(--text-muted); }
.banco-pill--novos      { border-color: rgba(59, 130, 246, .3); color: #3b82f6; }
.banco-pill--aprendendo { border-color: rgba(245, 158, 11, .3); color: #f59e0b; }
.banco-pill--revisao    { border-color: rgba(139, 92, 246, .3); color: #8b5cf6; }

/* Counts coloridos no header de progresso da sessão */
.banco-prog-novos      { color: #3b82f6; }
.banco-prog-aprendendo { color: #f59e0b; }
.banco-prog-revisao    { color: #8b5cf6; }
.banco-prog-accent     { color: var(--accent); }

/* Resultado: linha com 3 contagens coloridas */
.banco-result__counts {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  margin-top: 8px;
}

/* Botão primary roxo */
.btn-purple {
  width: 100%;
  padding: 14px;
  background: #8b5cf6;
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .15s ease;
  box-shadow: 0 4px 16px rgba(139, 92, 246, .25);
}
.btn-purple:hover {
  background: #7c3aed;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, .32);
}
.btn-purple--sm {
  padding: 12px 24px;
  width: auto;
  font-size: 14px;
}
.btn-purple--mostrar {
  width: 100%;
  max-width: 600px;
  padding: 13px;
  font-size: 14px;
  border-radius: 10px;
}
.btn-purple__hint { opacity: .6; font-size: 11px; font-weight: 500; }

/* Deck (flip + card) */
.banco-deck {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 20px;
  gap: 16px;
}
.banco-bar {
  width: 100%;
  max-width: 600px;
  height: 4px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.banco-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 99px;
  width: 0%;
  transition: width .4s ease;
}

.banco-card {
  width: 100%;
  max-width: 600px;
  min-height: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 16px;
  user-select: none;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .04);
  perspective: 1200px;
  transition: transform .2s ease;
}
.banco-card.flipped { animation: bancoFlip .45s ease-out; }
@keyframes bancoFlip {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(90deg); }
  51%  { transform: rotateY(-90deg); }
  100% { transform: rotateY(0deg); }
}
.banco-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.banco-card__front {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  flex: 1;
  font-weight: 500;
}
.banco-card__back {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.banco-card__back[hidden] { display: none; }
.banco-card__explicacao {
  padding: 16px 18px;
  background: rgba(139, 92, 246, .08);
  border-left: 3px solid #8b5cf6;
  border-radius: 0 10px 10px 0;
  font-size: 15px;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-line;
}

/* Botões SM-2 (4 níveis: Errei / Difícil / Bom / Fácil) */
.banco-rate-row {
  display: none;
  width: 100%;
  max-width: 600px;
  flex-direction: column;
  gap: 10px;
}
.banco-rate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.banco-btn-sm2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 8px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease;
  border: 1.5px solid;
  user-select: none;
}
.banco-btn-sm2:hover { transform: translateY(-1px); filter: brightness(1.1); }
.banco-btn-sm2 .prev  { font-size: 10px; font-weight: 500; opacity: .75; font-family: monospace; }
.banco-btn-sm2 .tecla { font-size: 9px;  opacity: .55; margin-top: 1px; }
.banco-btn-errei   { background: rgba(239, 68, 68, .12);  color: #ef4444; border-color: rgba(239, 68, 68, .4); }
.banco-btn-dificil { background: rgba(245, 158, 11, .12); color: #f59e0b; border-color: rgba(245, 158, 11, .4); }
.banco-btn-bom     { background: rgba(74, 222, 128, .12); color: #4ade80; border-color: rgba(74, 222, 128, .4); }
.banco-btn-facil   { background: rgba(59, 130, 246, .12); color: #3b82f6; border-color: rgba(59, 130, 246, .4); }

.banco-rate-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* Resultado final do banco */
.banco-result {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  gap: 16px;
  text-align: center;
}
.banco-result__emoji { font-size: 52px; }
.banco-result__title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.banco-result__sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}
.banco-result__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════
   MODAIS GENÉRICOS (overlay + card)
   Usado por: alterar senha (e candidato a outros modais)
   Toggle: classe .is-open (não usar style.display).
   ═════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: modalFade .18s ease;
}
.modal-overlay.is-open { display: flex; }
@keyframes modalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  position: relative;
  max-width: 400px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  font-family: var(--font);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  animation: modalIn .22s cubic-bezier(.22, .61, .36, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-card__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: var(--surface2);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: background .15s ease;
}
.modal-card__close:hover { background: var(--border); }

.modal-card__title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.modal-card__sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: var(--font);
  box-sizing: border-box;
  transition: border-color .15s ease;
}
.modal-input:focus { border-color: var(--accent); }

.modal-msg {
  display: none;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  border: 1px solid transparent;
}
.modal-msg.is-shown { display: block; }
.modal-msg--err {
  background: rgba(239, 68, 68, .12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, .3);
}
.modal-msg--ok {
  background: rgba(34, 197, 94, .12);
  color: #22c55e;
  border-color: rgba(34, 197, 94, .3);
}

.btn-modal-primary {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.btn-modal-primary:hover { background: #144d30; }
.btn-modal-primary:disabled { opacity: .6; cursor: default; }

/* Variante mais escura do overlay (quiz relâmpago) */
.modal-overlay--dark { background: rgba(0, 0, 0, .82); }

/* Variantes do modal-card / sc-modal-box */
.modal-card--md { max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 20px 22px; }
.modal-box--narrow { max-width: 340px; text-align: center; padding: 24px; }
.modal-title--lg { font-size: 18px; }
.modal-sub--gap  { margin-bottom: 24px; }

/* Ícone grande de aviso/info no topo do modal */
.modal-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

/* Linha de ações do modal (2 botões lado a lado) */
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, filter .15s ease;
}
.modal-btn--ghost {
  border: 1.5px solid rgba(255, 255, 255, .15);
  background: transparent;
  color: rgba(255, 255, 255, .6);
}
.modal-btn--ghost:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.modal-btn--danger {
  border: 0;
  background: #ef4444;
  color: #fff;
  font-weight: 700;
}
.modal-btn--danger:hover { filter: brightness(1.08); }

/* Estado de loading dentro de modal (gerando IA, carregando quiz...) */
.modal-loading {
  text-align: center;
  padding: 30px 0;
}
.modal-loading__icon {
  font-size: 42px;
  margin-bottom: 12px;
}
.modal-loading__title {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 6px;
}
.modal-loading__sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── @media print: quando o aluno clica "Imprimir / Salvar PDF" no
      gerador de provas (tela-gerador), imprime SÓ a prévia em A4 limpo.
      Esconde toda a UI do app (header, nav, bottom bar, paywall, etc). */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #fff !important; color: #111 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Esconde TUDO que não é a prévia da prova */
  header, .bottom-tab-bar, #_paywall, #tela-loading, #tela-login, #tela-cadastro,
  #tela-onboarding, #tela-dashboard, #tela-config, #tela-simulado, #tela-resultado,
  #tela-revisao, #tela-flashcard, #tela-montador, #tela-planejador, #tela-podcasts,
  #tela-materiais, #tela-redacao, #tela-quiz, .toast, .nav-fab,
  /* Header e editor do próprio tela-gerador são ocultos */
  #tela-gerador > div:first-of-type, #gp-editor, #gp-simulado-bar { display: none !important; }
  /* Mostra só o container da prévia, em layout de página normal */
  #tela-gerador, #gp-preview { display: block !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; max-width: none !important; background: #fff !important; box-shadow: none !important; }
  #gp-preview > div { box-shadow: none !important; border-radius: 0 !important; border: none !important; background: #fff !important; }
  /* Quebra de página inteligente: nunca cortar uma questão no meio */
  #gp-preview > div > div { break-inside: avoid; page-break-inside: avoid; }
  /* Cores fortes preservadas */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  /* Tipografia serif elegante na impressão (Fraunces > Georgia > Times) */
  #gp-preview { font-family: 'Fraunces', Georgia, 'Times New Roman', serif; }
  /* Margens estilo livro: gutter (lado interno) maior que externo */
  @page :left { margin: 18mm 18mm 18mm 14mm; }
  @page :right { margin: 18mm 14mm 18mm 18mm; }
  /* Cada bloco de página força break — capa, apresentação, sumário, contracapa */
  .gp-capa, .gp-apresentacao, .gp-sumario, .gp-contracapa, .gp-gabarito-final { page-break-after: always; break-after: page; }
  .gp-questao, .gp-texto-base, .gp-gabcom { page-break-inside: avoid; break-inside: avoid; }
  .gp-cap-disciplina { padding-top: 8mm; }
  /* Marca d'água lateral (vertical, suave) */
  .gp-watermark {
    position: fixed; top: 50%; right: 4mm; transform: translateY(-50%) rotate(-90deg);
    transform-origin: right center; font-size: 9pt; letter-spacing: .3em;
    color: #999; opacity: .15; pointer-events: none; white-space: nowrap; z-index: 9999;
  }
  /* Drop cap: primeira letra grande */
  .gp-enun-dropcap::first-letter {
    font-family: 'Fraunces', Georgia, serif; font-size: 3.4em; font-weight: 700;
    float: left; line-height: .85; padding: 0.05em 0.08em 0 0; color: inherit;
  }
}
/* Drop cap também no preview (tela) pra ver antes de imprimir */
.gp-enun-dropcap::first-letter {
  font-family: Georgia, serif; font-size: 3.2em; font-weight: 700;
  float: left; line-height: .85; padding: 0 0.06em 0 0;
}
.gp-watermark {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%) rotate(-90deg);
  transform-origin: right center; font-size: 9px; letter-spacing: .3em;
  color: #999; opacity: .25; pointer-events: none; white-space: nowrap;
}
.gp-page { position: relative; }

/* ═══════════════════════════════════════════════════════════════
   REDAÇÃO DISCURSIVA (correção manual) — js/redacao.js
   Tema claro (creme) do app: usa --radius-md/lg, --text-muted, --surface2.
   ═══════════════════════════════════════════════════════════════ */
.red-stage { padding: 16px 16px 90px; max-width: 760px; margin: 0 auto; width: 100%; }
.red-filtros { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
@media (min-width: 600px) { .red-filtros { grid-template-columns: 2fr 1fr 1fr; } }
.red-filtro-input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--surface); color: var(--text);
  font-size: 14px; box-sizing: border-box; transition: border-color .15s, box-shadow .15s;
}
.red-filtro-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,92,58,.12); }
.red-count { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; margin: 2px 2px 12px; }

.red-card {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(60,40,10,.05);
  transition: border-color .15s, box-shadow .15s, transform .06s;
}
.red-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(26,92,58,.12); }
.red-card:active { transform: scale(.995); }
.red-card__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.red-card__cod { font-weight: 800; color: var(--accent); font-size: 13px; letter-spacing: .02em; }
.red-card__tipo {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
  color: var(--accent); background: var(--surface2); padding: 3px 9px; border-radius: 99px;
}
.red-card__banca { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: 3px; }
.red-card__titulo { font-size: 15.5px; font-weight: 700; color: var(--text); line-height: 1.35; }

.red-badge {
  margin-left: auto; font-size: 11px; font-weight: 800; padding: 4px 11px;
  border-radius: 99px; background: var(--surface2); color: var(--text-muted);
}
.red-badge--ok   { background: rgba(26,92,58,.12);  color: #1a7a4a; }
.red-badge--wait { background: rgba(196,146,42,.16); color: #b07d13; }

/* Detalhe da questão */
.red-det-head { border-bottom: 2px solid var(--accent); padding-bottom: 12px; margin-bottom: 16px; }
.red-det-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.red-det-banca { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.red-det-titulo { font-family: Georgia, serif; font-size: 22px; color: var(--text); margin: 4px 0 0; line-height: 1.25; }
.red-enunciado { font-size: 15.5px; line-height: 1.65; color: var(--text); margin-bottom: 16px; }
.red-enunciado p { margin: 0 0 10px; }
.red-img { max-width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border); margin: 8px 0 16px; display: block; }
.red-apoio {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 16px; font-size: 14px; line-height: 1.6;
}
.red-apoio__label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 8px; }
.red-limite { font-size: 13px; font-weight: 600; color: #b07d13; margin-bottom: 16px; }

/* Envio — card destacado */
.red-envio {
  margin-top: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 6px 16px 18px; box-shadow: 0 1px 3px rgba(60,40,10,.05);
}
.red-tabs { display: flex; gap: 4px; margin: 0 -16px 14px; padding: 0 8px; border-bottom: 1px solid var(--border); }
.red-tab {
  flex: 1; padding: 14px 8px; background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13.5px; font-weight: 700; border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.red-tab--ativa { color: var(--accent); border-bottom-color: var(--accent); }
.red-textarea {
  width: 100%; box-sizing: border-box; padding: 15px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg); color: var(--text); font-size: 15.5px; line-height: 1.7;
  resize: vertical; min-height: 280px; font-family: Georgia, 'Times New Roman', serif;
  transition: border-color .15s, box-shadow .15s;
}
.red-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,92,58,.12); }
.red-foto-drop {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 34px 16px; border: 2px dashed var(--border);
  border-radius: var(--radius-md); color: var(--text-muted); font-size: 14px; cursor: pointer;
  background: var(--surface2); transition: border-color .15s, color .15s, background .15s;
}
.red-foto-drop:hover { border-color: var(--accent); color: var(--accent); background: rgba(26,92,58,.05); }
#red-foto-preview img { margin-top: 12px; }
.red-envio-acoes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.red-envio-acoes .btn-outline-accent { font-size: 15px; padding: 13px 26px; }
.red-envio-info { font-size: 13px; color: var(--text-muted); }
.red-aviso { margin-top: 14px; font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }

/* Resultado / pendente */
.red-resultado {
  margin-top: 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; box-shadow: 0 1px 3px rgba(60,40,10,.05);
}
.red-status { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.red-status--ok   { color: #1a7a4a; }
.red-status--wait { color: #b07d13; }
.red-status__msg { font-size: 14px; color: var(--text-muted); line-height: 1.55; margin: 0 0 14px; }
.red-nota {
  display: inline-flex; align-items: baseline; gap: 12px; background: rgba(26,92,58,.08);
  border: 1px solid rgba(26,92,58,.22); border-radius: var(--radius-md); padding: 12px 20px; margin-bottom: 16px;
}
.red-nota__label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: #1a7a4a; }
.red-nota__valor { font-family: Georgia, serif; font-size: 28px; font-weight: 800; color: var(--accent); }
.red-feedback {
  background: var(--surface2); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 14px; font-size: 15px; line-height: 1.65;
}
.red-feedback__label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 8px; }
.red-sua { margin-top: 16px; }
.red-sua__label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 8px; }
.red-sua__texto {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; font-size: 14.5px; line-height: 1.7; color: var(--text); font-family: Georgia, serif;
}
.red-minha-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(60,40,10,.05);
}
.red-minha-item__top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
