/* Passo Concurso — sistema de design (ver docs/design-system.md)
   Tokens → base → layout → componentes → páginas. Sem build, sem dependências. */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #0f172a;
  --text-2: #526071;
  --border: #e3e8ef;
  --border-strong: #7c8698;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --on-primary: #ffffff;
  --primary-soft: #e8efff;
  --primary-text: #1e40af;
  /* Marinho de autoridade (marca, herói da landing) e âmbar de destaque sobre ele. */
  --marca: #0b1a33;
  --marca-2: #122a52;
  --on-marca: #f8fafc;
  --on-marca-2: #c7d2e4;
  --acento: #f59e0b;
  --acento-hover: #fbbf24;
  --on-acento: #0b1a33;
  --acento-text: #b45309;
  --ok: #166534;
  --ok-soft: #e3f4e8;
  --warn: #8a4b08;
  --warn-soft: #fdf1dc;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --focus: #1d4ed8;
  --ramo-1: #1d4ed8; --ramo-2: #0f766e; --ramo-3: #6d28d9; --ramo-4: #b45309; --ramo-5: #be123c; --ramo-6: #15803d;

  --font: Figtree, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-display: Sora, Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 2rem;
  --lh: 1.55;
  --lh-reading: 1.7;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 999px;
  --shadow-1: 0 1px 2px rgb(15 23 42 / 5%), 0 1px 3px rgb(15 23 42 / 7%);
  --shadow-2: 0 8px 24px rgb(15 23 42 / 8%);
  --shadow-3: 0 24px 60px rgb(2 8 23 / 35%);
  --tap: 44px;
  --largura: 1040px;
  --largura-leitura: 72ch;
  --dur: 150ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f141c;
    --surface: #171e29;
    --surface-2: #202a37;
    --text: #e8ecf1;
    --text-2: #a8b2c0;
    --border: #2b3544;
    --border-strong: #6b7686;
    --primary: #8ab4ff;
    --primary-hover: #a9c7ff;
    --on-primary: #0b1426;
    --primary-soft: #1c2a44;
    --primary-text: #a9c7ff;
    --marca: #0b1a33;
    --marca-2: #122a52;
    --acento: #fbbf24;
    --acento-hover: #fcd34d;
    --acento-text: #f3c26b;
    --ok: #7ee2a0;
    --ok-soft: #16301f;
    --warn: #f3c26b;
    --warn-soft: #352812;
    --danger: #ff9b8f;
    --danger-soft: #3a1c19;
    --focus: #8ab4ff;
    --ramo-1: #8ab4ff; --ramo-2: #5eead4; --ramo-3: #c4b5fd; --ramo-4: #fcd34d; --ramo-5: #fda4af; --ramo-6: #86efac;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-2: 0 8px 24px rgb(0 0 0 / 45%);
    --shadow-3: 0 24px 60px rgb(0 0 0 / 60%);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
}

/* -------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: var(--lh);
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: var(--fs-2xl); font-weight: 800; }
h2 { font-size: var(--fs-xl); font-weight: 700; }
h3 { font-size: var(--fs-lg); font-weight: 600; }
p { margin: 0 0 var(--s3); }
a { color: var(--primary-text); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
code { font-family: var(--font-mono); font-size: 0.92em; background: var(--surface-2);
  padding: 1px 5px; border-radius: var(--r-sm); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pular { position: absolute; left: var(--s4); top: -60px; z-index: 50; background: var(--primary);
  color: var(--on-primary); padding: var(--s2) var(--s4); border-radius: var(--r-md); }
.pular:focus { top: var(--s2); }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; }
/* Palavras e URLs longas quebram a linha em vez de alargar a página (celular). */
main { overflow-wrap: break-word; }
.base, .item, .explicacao, .fonte, .flashcard, .veredito, .notice, .vazio, .card { overflow-wrap: anywhere; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }

/* ------------------------------------------------------------------ layout */
.app-header {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.app-header__in {
  max-width: var(--largura); margin: 0 auto; padding: 0 var(--s4);
  display: flex; align-items: center; gap: var(--s4); min-height: 60px;
}
.marca { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; color: var(--text);
  text-decoration: none; display: flex; gap: 10px; align-items: center; min-height: var(--tap); }
.marca__sinal { width: 28px; height: 28px; border-radius: 8px; background: var(--marca);
  color: var(--acento); display: grid; place-items: center; font-size: 11px; font-weight: 800;
  font-family: var(--font-display); letter-spacing: 0; flex: none; }
.nav { display: flex; gap: var(--s1); margin-left: auto; }
.nav a {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 14px;
  border-radius: var(--r-md); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: var(--fs-sm);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full);
  background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center; }

.curso-atual { font-size: var(--fs-sm); color: var(--text-2); text-decoration: none; padding: var(--s1) var(--s3);
  border: 1px solid var(--border); border-radius: var(--r-full); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 260px; }
.curso-atual:hover { background: var(--surface-2); color: var(--text); }
.conta { margin-left: auto; }
.nav ~ .conta { margin-left: 0; }
.conta { display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s2) 0 var(--s1);
  border-radius: var(--r-full); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); }
.conta:hover { background: var(--surface-2); color: var(--text); }
.conta[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); }
.conta__inicial { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text);
  display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); flex: none; }

/* tela de login e perfil */
.auth { max-width: 420px; margin: var(--s6) auto 0; }
.auth__card { padding: var(--s6); }
.auth__marca { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s2); }
.auth__marca h1 { font-size: var(--fs-xl); margin: var(--s2) 0 0; }
.auth__marca p { margin: 0; }
.auth__card .btn--block { margin-top: var(--s2); }
.auth__marca a.marca__sinal { text-decoration: none; }
.auth__links { text-align: center; margin: 0; }
.aceite { display: block; position: relative; padding: 10px 0 10px 36px; min-height: var(--tap); line-height: 1.5;
  cursor: pointer; }
.aceite input { position: absolute; left: 0; top: 8px; width: 24px; height: 24px; margin: 0;
  accent-color: var(--primary); cursor: pointer; }
.aceite a { padding: 2px 0; }

/* escolha de curso */
.cursos-grade { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.cursos-grade h3 { margin: 0; font-size: var(--fs-lg); }
.zona-perigo { border-color: var(--danger); }

.tabbar { display: none; }
main { max-width: var(--largura); margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }

@media (max-width: 480px) { .marca__nome { display: none; } }
@media (max-width: 720px) {
  .nav { display: none; }
  .nav ~ .conta { margin-left: auto; }
  .conta__nome { display: none; }
  .marca { white-space: nowrap; }
  .conta { padding: 0; }
  .curso-atual { max-width: 44vw; }
  .app-header__in { min-height: 56px; }
  main { padding: var(--s4) var(--s4) calc(var(--s7) + 64px); }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 60px; color: var(--text-2); text-decoration: none; font-size: 12px; font-weight: 600;
    position: relative;
  }
  .tabbar a[aria-current="page"] { color: var(--primary-text); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%;
    height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
  .tabbar .badge { position: absolute; top: 6px; left: 55%; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: var(--s3); margin-bottom: var(--s5); }
.page-head > div:first-child { flex: 1 1 480px; min-width: 0; }
.page-head__acao { margin-left: auto; }
.page-head__eyebrow { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--s1); }
.page-head__eyebrow a { color: inherit; display: inline-block; padding: var(--s2) 0; }
.page-head__sub { color: var(--text-2); margin: var(--s2) 0 0; max-width: 70ch; font-size: var(--fs-sm); }
@media (max-width: 720px) {
  /* Ação secundária (ex.: Descartar) no canto, sem ocupar uma linha só para ela */
  .page-head:has(> .page-head__acao) { position: relative; }
  .page-head:has(> .page-head__acao) .page-head__eyebrow { padding-right: 96px; }
  .page-head__acao { position: absolute; top: 0; right: calc(-1 * var(--s2)); padding: 0 var(--s2); }
}
.secao { margin-top: var(--s6); }
.secao__titulo { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
  margin-bottom: var(--s3); }
.secao__titulo h2 { font-size: 1.25rem; }
.secao__titulo a { padding: var(--s2) 0; }
.grid { display: grid; gap: var(--s3); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stack > * + * { margin-top: var(--s3); }
.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }

/* ------------------------------------------------------------- componentes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s5); }
.card--flush { padding: 0; overflow: hidden; }
@media (max-width: 720px) { .card { padding: var(--s4); } }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn--acento { background: var(--acento); color: var(--on-acento); }
.btn--acento:hover { background: var(--acento-hover); color: var(--on-acento); }
.btn--vazado { background: transparent; color: var(--on-marca); border-color: rgb(255 255 255 / 28%); }
.btn--vazado:hover { background: rgb(255 255 255 / 8%); color: #fff; }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-2); color: var(--text); }
.btn--ghost { background: transparent; color: var(--primary-text); }
.btn--ghost:hover { background: var(--primary-soft); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn--lg { min-height: 54px; padding: 0 var(--s5); font-size: 1.0625rem; border-radius: 14px; font-weight: 700; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--surface-2); color: var(--text-2);
  border-color: var(--border); cursor: not-allowed; }

/* Etiquetas de status (sempre texto + cor) */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 600; background: var(--surface-2); color: var(--text-2);
  white-space: nowrap; max-width: 100%; }
/* Etiquetas longas (pegadinhas, conclusões) quebram a linha em vez de estourar a tela */
.tag--plain { white-space: normal; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag--plain::before { display: none; }
.tag--ok { background: var(--ok-soft); color: var(--ok); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--danger { background: var(--danger-soft); color: var(--danger); }
.tag--info { background: var(--primary-soft); color: var(--primary-text); }

/* Medidor: barra com marcador opcional de mínimo */
.meter { position: relative; height: 10px; border-radius: var(--r-full); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border); }
.meter__fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--primary);
  min-width: 2px; }
.meter__fill--ok { background: var(--ok); }
.meter__fill--danger { background: var(--danger); }
.meter__min { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text);
  border-radius: 1px; }
.meter--sm { height: 6px; }
/* Faixa provável da projeção: banda do percentil baixo ao alto, ponto no valor esperado */
.meter__faixa { position: absolute; top: 0; bottom: 0; border-radius: inherit;
  background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.meter__ponto { position: absolute; top: -3px; width: 16px; height: 16px; margin-left: -8px;
  border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.projecao__faixa { display: block; font-size: var(--fs-sm); color: var(--text-2); }
.projecao__chance { display: block; font-size: var(--fs-sm); }
.projecao__chance strong { font-variant-numeric: tabular-nums; }
.projecao__vazia ul { margin: var(--s2) 0 0; padding-left: 1.2em; }
/* Prova completa: resultado por bloco */
.prova-resultado td, .prova-resultado th { vertical-align: top; }

/* Avisos */
.notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4);
  border-radius: var(--r-md); background: var(--primary-soft); color: var(--text); }
.notice .icon { color: var(--primary-text); margin-top: 2px; }
.notice--warn { background: var(--warn-soft); }
.notice--warn .icon { color: var(--warn); }
.notice--ok { background: var(--ok-soft); }
.notice--ok .icon { color: var(--ok); }
.notice p:last-child { margin-bottom: 0; }

/* Número em destaque */
.kpi__valor { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; }
.kpi__rotulo { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }

/* Tabela */
.tabela { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tabela th { text-align: left; font-weight: 600; color: var(--text-2); padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--border); white-space: nowrap; }
.tabela td { padding: var(--s3); border-bottom: 1px solid var(--border); vertical-align: top; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .num { text-align: right; }
.tabela-wrap { overflow-x: auto;
  /* Sombra na borda enquanto houver colunas escondidas (sem JS): some ao chegar na ponta */
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left / 28px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(15 23 42 / 22%), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(15 23 42 / 22%), transparent) right / 12px 100% no-repeat scroll,
    var(--surface); }
.tabela-wrap:focus-visible { outline-offset: -3px; }
.tabela-dica { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-xs); color: var(--text-2);
  margin: 0 0 var(--s2); }
/* Tabela que vira cartões no celular: cada célula leva o rótulo da coluna (data-rotulo) */
@media (max-width: 640px) {
  table.tabela--cartoes thead { display: none; }
  table.tabela--cartoes, table.tabela--cartoes tbody, table.tabela--cartoes tr, table.tabela--cartoes th, table.tabela--cartoes td { display: block; width: auto; }
  table.tabela--cartoes tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
  table.tabela--cartoes tr:last-child { border-bottom: 0; }
  table.tabela--cartoes th, table.tabela--cartoes td { border: 0; padding: 2px 0; white-space: normal; text-align: left; }
  table.tabela--cartoes tbody th[scope="row"], table.tabela--cartoes td:first-child { font-size: var(--fs-md); font-weight: 700; color: var(--text); padding-bottom: var(--s1); }
  table.tabela--cartoes td[data-rotulo] { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; }
  table.tabela--cartoes td[data-rotulo]::before { content: attr(data-rotulo); color: var(--text-2); font-weight: 600; flex: none; max-width: 55%; }
  table.tabela--cartoes td.num { text-align: right; }
  table.tabela--cartoes td[data-rotulo] > * { min-width: 0; }
  table.tabela--cartoes td.celula-larga[data-rotulo] { flex-direction: column; align-items: stretch; gap: var(--s1); }
  table.tabela--cartoes td.celula-larga[data-rotulo]::before { max-width: none; }
  table.tabela--cartoes .lp-vazia { display: none; }
}

/* Estado vazio */
.vazio { text-align: center; padding: var(--s6) var(--s4); color: var(--text-2); }
.vazio strong { display: block; color: var(--text); font-size: var(--fs-lg); margin-bottom: var(--s2); }

/* Diálogo */
dialog { border: 0; border-radius: var(--r-lg); padding: var(--s5); max-width: 420px; width: calc(100% - 32px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); }
dialog::backdrop { background: rgb(0 0 0 / 45%); }
dialog h2 { font-size: var(--fs-lg); margin-bottom: var(--s2); }
.dialog__acoes { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--s4); }

/* Barra fixa de ação (rodapé) */
.barra-acao { position: sticky; bottom: 0; z-index: 10; margin-top: var(--s5);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px);
  border-top: 1px solid var(--border); padding: var(--s3) 0; display: flex; gap: var(--s3);
  align-items: center; justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 720px) {
  .barra-acao { bottom: calc(58px + env(safe-area-inset-bottom)); flex-wrap: wrap; gap: var(--s2); padding: var(--s2) 0; }
  .barra-acao .btn--lg { min-height: var(--tap); font-size: var(--fs-md); padding: 0 var(--s4); }
  /* Dois botões dividem a linha; o rótulo quebra dentro do botão em vez de estourar a tela */
  .barra-acao > .btn, .barra-acao > form { flex: 0 1 auto; min-width: 0; }
  .barra-acao:has(> .btn + .btn) > .btn { flex: 1 1 0; }
  .barra-acao > form .btn { width: 100%; }
  .barra-acao .btn { white-space: normal; text-align: center; line-height: 1.2; padding-top: var(--s1); padding-bottom: var(--s1); }
  .barra-acao > .contador, .barra-acao > span { flex: 1 1 auto; min-width: 0; }
  .barra-acao > :only-child { flex: 1 1 auto; }
}

/* --------------------------------------------------------------- Hoje */
.hoje-topo { display: grid; gap: var(--s3); grid-template-columns: 1.6fr 1fr; margin-bottom: var(--s5); }
@media (max-width: 860px) { .hoje-topo { grid-template-columns: 1fr; } }
.proxima { border: 2px solid var(--primary); box-shadow: var(--shadow-2); display: flex; flex-direction: column;
  gap: var(--s3); }
.proxima__tipo { font-size: var(--fs-sm); font-weight: 700; color: var(--primary-text); text-transform: uppercase;
  letter-spacing: 0.04em; }
.proxima__titulo { font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; }
.proxima__meta { color: var(--text-2); font-size: var(--fs-sm); }
.dia { display: flex; flex-direction: column; gap: var(--s3); }
.dia__linha { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.dia__grande { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.semana { border-top: 1px solid var(--border); padding-top: var(--s3); display: flex; flex-direction: column;
  gap: var(--s2); }
.semana__dias { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--s1); }
.semana__dia { justify-self: center; width: 100%; max-width: 34px; aspect-ratio: 1; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border-strong); font-size: var(--fs-xs); font-weight: 700;
  color: var(--text-2); }
.semana__dia--feito { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.semana__dia--futuro { border-style: dashed; border-color: var(--border-strong); }
.semana__dia--andamento { border-color: var(--ok); border-style: dashed; color: var(--ok); }
.semana__dia--hoje { outline: 2px solid var(--primary); outline-offset: 2px; }
.retomada { border-left: 4px solid var(--primary); }

.plano { list-style: none; margin: 0; padding: 0; }
.bloco + .bloco { margin-top: var(--s4); }
.bloco__titulo { font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); text-transform: uppercase;
  letter-spacing: 0.04em; margin: 0 0 var(--s2); display: flex; gap: var(--s2); align-items: center; }
.passo { display: grid; grid-template-columns: 36px 1fr auto; gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); }
.passo + .passo { margin-top: var(--s2); }
.passo__icone { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); }
.passo__titulo { font-weight: 600; }
.passo__meta { font-size: var(--fs-sm); color: var(--text-2); }
.passo--feito { opacity: 0.6; }
.passo--pendente .passo__icone { background: var(--warn-soft); color: var(--warn); }
/* Duas ações com hierarquia (ex.: "Abrir e terminar" e "Descartar"): lado a lado, a
   principal primeiro; a secundária é um botão discreto, nunca empilhado com o mesmo peso. */
.passo__acoes { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.passo__acoes .btn--ghost { color: var(--text-2); }
@media (max-width: 560px) {
  .passo { grid-template-columns: 36px 1fr; }
  .passo form, .passo .btn { grid-column: 1 / -1; }
  .passo .btn { width: 100%; }
  .passo .passo__acoes { grid-column: 1 / -1; }
  .passo__acoes form:first-child { flex: 1 1 auto; }
  .passo .passo__acoes .btn--ghost { width: auto; }
}

/* ----------------------------------------------------- Atividade / leitura */
.leitura-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--s6); align-items: start; }
@media (max-width: 960px) { .leitura-layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
.toc { position: sticky; top: 76px; font-size: var(--fs-sm); max-height: calc(100vh - 100px); overflow: auto;
  scrollbar-width: thin; overscroll-behavior: contain; }
.toc__titulo { font-weight: 700; color: var(--text-2); margin-bottom: var(--s2); font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: 0.05em; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc li a { display: block; padding: 4px var(--s3); color: var(--text-2); text-decoration: none; margin-left: -2px;
  border-left: 2px solid transparent; }
.toc li a:hover { color: var(--text); border-left-color: var(--border-strong); }
.toc ul ul { border: 0; padding-left: var(--s3); }

.prosa { max-width: var(--largura-leitura); font-size: 1.0625rem; line-height: var(--lh-reading);
  overflow-wrap: break-word; }
.prosa h1 { font-size: var(--fs-2xl); margin: 0 0 var(--s4); }
.prosa h2 { font-size: var(--fs-xl); margin: var(--s6) 0 var(--s3); padding-top: var(--s2); }
.prosa h3 { font-size: var(--fs-lg); margin: var(--s5) 0 var(--s2); }
.prosa ul, .prosa ol { padding-left: 1.4em; margin: 0 0 var(--s3); }
.prosa li { margin: 0.25em 0; }
.prosa table { width: 100%; border-collapse: collapse; margin: var(--s4) 0; font-size: var(--fs-sm);
  display: block; overflow-x: auto; }
.prosa th, .prosa td { border: 1px solid var(--border); padding: var(--s2) var(--s3); text-align: left; vertical-align: top; }
.prosa th { background: var(--surface-2); }
.prosa blockquote { margin: var(--s4) 0; padding: var(--s3) var(--s4); background: var(--primary-soft);
  border-left: 4px solid var(--primary); border-radius: 0 var(--r-md) var(--r-md) 0; }
.prosa blockquote p:last-child { margin: 0; }
/* Caixas didáticas (apresentacao.classificar_caixas): as cores vêm dos tokens, então valem nos temas claro,
   escuro, sépia e preto sem regra extra. */
.prosa .caixa { --caixa: var(--primary); --caixa-fundo: var(--primary-soft); background: var(--caixa-fundo);
  border-left-color: var(--caixa); }
.prosa .caixa > p:first-child { margin-top: 0; }
.prosa .caixa--prova { --caixa: var(--primary); --caixa-fundo: var(--primary-soft); }
.prosa .caixa--exemplo { --caixa: var(--ok); --caixa-fundo: var(--ok-soft); }
.prosa .caixa--pegadinha { --caixa: var(--danger); --caixa-fundo: var(--danger-soft); }
.prosa .caixa--atencao { --caixa: var(--warn); --caixa-fundo: var(--warn-soft); }
.prosa .caixa--teste { --caixa: var(--ramo-3); --caixa-fundo: color-mix(in srgb, var(--ramo-3) 12%, var(--surface)); }
/* Teste rápido: a resposta (último parágrafo, depois do enunciado e das alternativas em parágrafos
   ou em lista) vem separada, para o aluno julgar antes de ler */
.prosa .caixa--teste > p:last-child:not(:first-child) { margin-top: var(--s5); padding-top: var(--s3);
  border-top: 1px dashed color-mix(in srgb, var(--caixa) 45%, transparent); }
/* A resposta do teste rápido fica dobrada até o aluno clicar */
.prosa .caixa--teste > .resposta { margin-top: var(--s4); border-top: 1px dashed color-mix(in srgb, var(--caixa) 45%, transparent); padding-top: var(--s3); }
.prosa .caixa--teste > .resposta > summary { cursor: pointer; font-weight: 700; color: var(--caixa); list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.prosa .caixa--teste > .resposta > summary::-webkit-details-marker { display: none; }
.prosa .caixa--teste > .resposta > summary::before { content: "▸"; transition: transform .15s; }
.prosa .caixa--teste > .resposta[open] > summary::before { transform: rotate(90deg); }
.prosa .caixa--teste > .resposta[open] > summary { color: var(--text-2); }
.prosa .caixa--teste > .resposta > p { margin: var(--s2) 0 0; }
.prosa pre { background: var(--surface-2); padding: var(--s3); border-radius: var(--r-md); overflow-x: auto; }
.prosa :target { scroll-margin-top: 80px; }
.progresso-leitura { position: fixed; top: 0; left: 0; height: 3px; background: var(--primary); width: 0; z-index: 40; }

/* Mapa mental: listas aninhadas viram árvore */
.arvore ul ul { list-style: none; padding-left: var(--s5); margin: var(--s1) 0; border-left: 2px solid var(--border); }
.arvore li { position: relative; margin: 6px 0; }
.arvore ul ul li::before { content: ""; position: absolute; left: calc(-1 * var(--s5)); top: 0.8em;
  width: calc(var(--s5) - 6px); border-top: 2px solid var(--border); }
.arvore li > p:first-child { display: inline; }

/* Cartões de memorização (virar com clique/Enter) */
.flashcards { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.flashcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.flashcard summary { list-style: none; cursor: pointer; padding: var(--s4); font-weight: 600; min-height: var(--tap);
  display: flex; justify-content: space-between; gap: var(--s3); }
.flashcard summary::-webkit-details-marker { display: none; }
.flashcard summary::after { content: "Ver resposta"; font-size: var(--fs-xs); font-weight: 600; color: var(--primary-text);
  white-space: nowrap; }
.flashcard[open] summary::after { content: "Ocultar"; }
.flashcard--apoio summary { min-height: 0; padding: var(--s3) var(--s4); font-weight: 500; }
.flashcard--apoio summary::after { content: "Mostrar"; }
.flashcard--apoio[open] summary::after { content: "Ocultar"; }
.flashcard__verso { padding: 0 var(--s4) var(--s4); color: var(--text); border-top: 1px dashed var(--border);
  padding-top: var(--s3); }

/* ------------------------------------------------- Itens Certo/Errado */
.questoes-topo { position: sticky; top: 56px; z-index: 12; background: var(--bg); padding: var(--s2) 0;
  display: flex; align-items: center; gap: var(--s3); justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 720px) { .questoes-topo { top: 52px; } }
.contador { font-weight: 600; font-variant-numeric: tabular-nums; }
.cronometro { display: inline-flex; align-items: center; gap: var(--s2); font-variant-numeric: tabular-nums;
  font-weight: 700; padding: var(--s1) var(--s3); border-radius: var(--r-full); background: var(--surface);
  border: 1px solid var(--border); }
.cronometro--estourou { color: var(--danger); border-color: var(--danger); }

.base { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s4); white-space: pre-wrap;
  font-size: var(--fs-md); line-height: var(--lh-reading); margin-bottom: var(--s3); }
.base__rotulo { display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--s2); white-space: normal; }
.grupo + .grupo { margin-top: var(--s6); }
/* Prova completa: cabeçalhos de bloco e disciplina na ordem do caderno. */
.prova-secao__bloco { font-size: var(--fs-lg); margin: var(--s7) 0 var(--s2); padding-bottom: var(--s2);
  border-bottom: 2px solid var(--border); }
.prova-secao__disciplina { font-size: var(--fs-md); margin: var(--s6) 0 var(--s3); }
.prova-secao__bloco + .prova-secao__disciplina { margin-top: var(--s3); }

.item { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  padding: var(--s4); margin: 0; min-width: 0; }
.item + .item { margin-top: var(--s3); }
.item__enunciado { font-size: var(--fs-md); line-height: var(--lh-reading); padding: 0; margin-bottom: var(--s3);
  float: left; width: 100%; }
.item__enunciado + * { clear: both; }
.item__num { font-weight: 700; margin-right: var(--s2); }
.item:has(input[value="C"]:checked), .item:has(input[value="E"]:checked) { border-color: var(--border-strong); }

.escolha { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.escolha label, .confianca label { position: relative; }
.escolha input, .confianca input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.escolha span {
  display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--tap);
  border: 1px solid var(--border-strong); border-radius: var(--r-md); font-weight: 600; background: var(--surface);
  color: var(--text); text-align: center; padding: 0 var(--s2); transition: background var(--dur);
}
.escolha label:hover span { background: var(--surface-2); }
.escolha input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.escolha input[value="B"]:checked + span { background: var(--surface-2); color: var(--text); border-color: var(--text-2); }
.escolha input:focus-visible + span, .confianca input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.confianca { display: none; margin-top: var(--s3); align-items: center; gap: var(--s2); flex-wrap: wrap; border: 0;
  padding: 0; }
.item:has(input[value="C"]:checked) .confianca,
.item:has(input[value="E"]:checked) .confianca { display: flex; }
.confianca legend { float: left; font-size: var(--fs-sm); color: var(--text-2); margin-right: var(--s2); padding: 0; }
.confianca span { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s3);
  border-radius: var(--r-full); border: 1px solid var(--border-strong); font-size: var(--fs-sm); font-weight: 600;
  background: var(--surface); }
.confianca input:checked + span { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary); }

/* Correção */
.resultado { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: var(--s5); }
/* múltipla escolha: alternativas em lista, uma por linha */
.escolha--me { grid-template-columns: 1fr; }
.escolha--me span { justify-content: flex-start; text-align: left; gap: var(--s3); padding: var(--s2) var(--s3); height: auto; min-height: var(--tap); font-weight: 400; }
.letra { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-full);
  border: 1px solid currentColor; font-size: var(--fs-sm); font-weight: 700; margin-right: var(--s2); }
.item:has(.escolha--me input:not([value="B"]):checked) .confianca { display: flex; }
.destaque { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.alternativas { list-style: none; padding: 0; margin: var(--s3) 0; display: grid; gap: var(--s2); }
.alternativas li { display: flex; align-items: flex-start; padding: var(--s2) var(--s3); border-radius: var(--r-md);
  border: 1px solid var(--border); }
.alternativa--certa { border-color: var(--ok) !important; background: var(--ok-soft); }
.alternativa--marcada { border-color: var(--danger) !important; }
.item--c1 { border-left: 6px solid var(--ok); }
.item--c0 { border-left: 6px solid var(--danger); }
.item--c-1 { border-left: 6px solid var(--border-strong); }
.veredito { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; font-size: var(--fs-sm);
  margin-bottom: var(--s3); }
.explicacao { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.explicacao p:last-child { margin: 0; }
.fonte { font-size: var(--fs-xs); color: var(--text-2); margin-top: var(--s2); }

/* ---------------------------------------------------------- Edital */
.filtro { width: 100%; min-height: var(--tap); padding: 0 var(--s4); border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; }
.disciplina { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.disciplina + .disciplina { margin-top: var(--s2); }
.disciplina > summary { list-style: none; cursor: pointer; padding: var(--s3) var(--s4); display: grid;
  grid-template-columns: 1fr auto; gap: var(--s1) var(--s3); align-items: center; min-height: 60px; }
.disciplina > summary::-webkit-details-marker { display: none; }
.disciplina > summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2); transform: rotate(45deg); grid-row: 1 / span 2; grid-column: 2;
  transition: transform var(--dur); margin-right: var(--s1); }
.disciplina[open] > summary::after { transform: rotate(225deg); }
.disciplina__nome { font-weight: 700; }
.disciplina__meta { font-size: var(--fs-sm); color: var(--text-2); display: flex; gap: var(--s3); align-items: center;
  flex-wrap: wrap; }
.disciplina__barra { width: 120px; }
.topicos { list-style: none; margin: 0; padding: 0 var(--s2) var(--s2); }
.topicos li a { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: center;
  padding: var(--s2) var(--s3); border-radius: var(--r-md); text-decoration: none; color: var(--text); min-height: var(--tap); }
.topicos li a:hover { background: var(--surface-2); }
.topicos__cod { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-2); min-width: 72px; }
.topicos__dir { display: flex; gap: var(--s2); align-items: center; font-size: var(--fs-xs); color: var(--text-2); }
@media (max-width: 560px) { .topicos li a { grid-template-columns: 1fr; gap: var(--s1); } }

/* ------------------------------------------------------------ Abas */
.abas { display: flex; gap: var(--s1); border-bottom: 1px solid var(--border); margin-bottom: var(--s5); overflow-x: auto; }
.abas a { padding: var(--s3) var(--s4); color: var(--text-2); text-decoration: none; font-weight: 600;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.abas a[aria-current="page"] { color: var(--primary-text); border-bottom-color: var(--primary); }

/* Menu "Mais" (mobile) */
.menu-lista { list-style: none; margin: 0; padding: 0; }
.menu-lista a { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); min-height: 56px;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.menu-lista li:last-child a { border-bottom: 0; }
.menu-lista .muted { margin-left: auto; }

/* Formulários */
.campo { display: flex; flex-direction: column; gap: var(--s1); }
.campo label { font-weight: 600; font-size: var(--fs-sm); }
.campo input, .campo select { min-height: 48px; padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid #cbd5e1;
  background: var(--surface); color: var(--text); font: inherit; width: 100%; }
.horas { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--s3); }

/* ------------------------------------------------------------- Memorização */
.btn--sm { padding: 0 var(--s3); font-size: var(--fs-sm); }
.roteiro ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.roteiro a { display: flex; gap: var(--s3); align-items: center; min-height: 60px; padding: var(--s3) var(--s4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text);
  text-decoration: none; transition: border-color var(--dur); }
.roteiro a:hover { border-color: var(--primary); }
.roteiro strong { display: block; }
@media (max-width: 560px) { .roteiro ol { grid-template-columns: 1fr 1fr; } .roteiro a { padding: var(--s2) var(--s3); gap: var(--s2); } }
.roteiro__resumo { display: block; font-size: var(--fs-xs); color: var(--text-2); }
.roteiro__n, .passo-titulo__n { flex: none; width: 28px; height: 28px; border-radius: var(--r-full); display: grid;
  place-items: center; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: var(--fs-sm); }
.passo-titulo { display: flex; align-items: center; gap: var(--s3); }
#mnemonicos, #mapa, #quadro, #cartoes { scroll-margin-top: 72px; }
.secao__guia { color: var(--text-2); font-size: var(--fs-sm); max-width: 72ch; margin: 0 0 var(--s4); }

/* Letra ou sílaba do acróstico */
strong.ini { color: var(--primary-text); background: var(--primary-soft); border-radius: 4px; padding: 0 2px;
  font-weight: 800; }

/* Mnemônicos: cartões numerados em grade (ordem de leitura por linha) */
.mnemos { display: grid; gap: var(--s3); align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.mnemo { position: relative; background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--r-lg);
  padding: var(--s4) var(--s4) var(--s4) 44px; line-height: 1.6; }
.mnemo__n { position: absolute; left: 12px; top: 17px; width: 22px; height: 22px; border-radius: var(--r-full);
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs);
  font-weight: 700; }
.mnemo__corpo > :first-child { margin-top: 0; }
.mnemo__corpo > :last-child { margin-bottom: 0; }
.mnemo__corpo p, .mnemo__corpo ul, .mnemo__corpo ol { margin: 0 0 var(--s2); }
.mnemo__corpo ul, .mnemo__corpo ol { padding-left: 1.2em; }
.mnemo__corpo li { margin: 4px 0; }
.mnemo__corpo > p:first-child > strong:first-child:not(.ini), .mnemo__titulo { font-size: var(--fs-lg);
  color: var(--primary-text); line-height: 1.4; }
.mnemo__titulo strong { color: inherit; }

/* Avisos dentro dos mnemônicos: "Cuidado" (troca da banca) e dicas (rima, frase, truque) */
.mnemo__corpo li.cuidado, .mnemo__corpo li.dica { list-style: none; margin-left: -1.2em; }
.cuidado, .nota-cuidado { display: block; background: var(--warn-soft); border-radius: var(--r-md);
  padding: var(--s2) var(--s3); margin-top: var(--s2); }
.dica, .nota-dica { display: block; background: var(--surface-2); border-radius: var(--r-md);
  padding: var(--s2) var(--s3); margin-top: var(--s2); }
.selo-cuidado, .selo-dica { display: inline-flex; align-items: center; gap: 4px; margin-right: 4px;
  font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: 1px; }
.selo-cuidado { color: var(--warn); }
.selo-dica { color: var(--primary-text); }
.selo-cuidado::before, .selo-dica::before { content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--icone) center / contain no-repeat; mask: var(--icone) center / contain no-repeat; }
.selo-cuidado { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9L1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.selo-dica { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7V16h8v-1.3A7 7 0 0 0 12 2z'/%3E%3C/svg%3E"); }

/* Mapa mental: centro + ramos coloridos recolhíveis */
.mapa__centro { position: relative; width: fit-content; max-width: 100%; margin: 0 auto var(--s5);
  padding: var(--s3) var(--s5); border-radius: var(--r-full); background: var(--primary); color: var(--on-primary);
  font-weight: 700; font-size: var(--fs-lg); text-align: center; box-shadow: var(--shadow-2); }
.mapa__centro::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: var(--s5);
  background: var(--border-strong); }
.mapa__ramos { display: grid; gap: var(--s3); align-items: start; padding-top: var(--s3);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); border-top: 2px solid var(--border); }
.ramo { --ramo: var(--ramo-1); background: var(--surface); border: 1px solid var(--border);
  border-top: 4px solid var(--ramo); border-radius: var(--r-lg); }
.ramo--2 { --ramo: var(--ramo-2); } .ramo--3 { --ramo: var(--ramo-3); } .ramo--4 { --ramo: var(--ramo-4); }
.ramo--5 { --ramo: var(--ramo-5); } .ramo--6 { --ramo: var(--ramo-6); }
.ramo > summary { list-style: none; cursor: pointer; display: flex; gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s4); min-height: var(--tap); font-weight: 700; }
.ramo > summary::-webkit-details-marker { display: none; }
.ramo > summary::after { content: ""; flex: none; margin-left: auto; width: 8px; height: 8px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg);
  transition: transform var(--dur); }
.ramo[open] > summary::after { transform: rotate(-135deg); }
.ramo__n { flex: none; width: 26px; height: 26px; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--ramo); color: var(--surface); font-size: var(--fs-xs); font-weight: 800; }
.ramo__arvore, .ramo__arvore ul { list-style: none; margin: 0; padding: 0; }
.ramo__arvore { padding: 0 var(--s4) var(--s4); font-size: var(--fs-sm); line-height: 1.5; }
.ramo__arvore li { position: relative; padding-left: 14px; margin: 6px 0; }
.ramo__arvore li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px;
  background: var(--ramo); opacity: 0.6; }
.ramo__arvore ul { margin: 4px 0 0 2px; padding-left: var(--s2); border-left: 2px solid var(--border); }
.ramo__arvore > li > .no { font-weight: 600; }
.ramo__arvore ul .no { color: var(--text-2); }
.ramo__arvore ul .no strong { color: var(--text); }

/* Quadro: certo × banca, com modo de teste */
.quadro { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.5; }
.quadro th, .quadro td { padding: var(--s3); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.quadro thead th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.quadro thead th.q-certo { color: var(--ok); }
.quadro thead th.q-errado { color: var(--danger); }
.quadro .q-ponto { font-weight: 600; width: 28%; }
.quadro td.q-certo { background: var(--ok-soft); }
.quadro td.q-errado { color: var(--text-2); }
.quadro td.q-errado .q-txt { text-decoration: line-through; text-decoration-thickness: 1px;
  text-decoration-color: var(--danger); }
.quadro tbody tr:last-child > * { border-bottom: 0; }
.q-revelar { display: none; }
.quadro--teste td.q-certo:not(.revelado) .q-txt { display: none; }
.quadro--teste td.q-certo:not(.revelado) .q-revelar { display: inline-flex; align-items: center; min-height: var(--tap);
  padding: 0 var(--s3); border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface);
  color: var(--primary-text); font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 640px) {
  .quadro thead { display: none; }
  .quadro tr { display: block; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
  .quadro tbody tr:last-child { border-bottom: 0; }
  .quadro th, .quadro td { display: block; border: 0; width: auto; }
  .quadro .q-ponto { padding: 0 0 var(--s1); width: auto; }
  .quadro td { padding: var(--s2) var(--s3); border-radius: var(--r-md); margin-top: var(--s2); }
  .quadro td::before { content: attr(data-rotulo); display: block; font-size: var(--fs-xs); font-weight: 700;
    color: var(--text-2); margin-bottom: 2px; }
  .quadro td.q-certo::before { content: "✓ " attr(data-rotulo); color: var(--ok); }
  .quadro td.q-errado { background: var(--surface-2); }
  .quadro td.q-errado::before { content: "✗ " attr(data-rotulo); color: var(--danger); }
}

/* Cartões numerados, com marca de "visto" */
.flashcard__n { flex: none; display: inline-grid; place-items: center; min-width: 24px; height: 24px;
  border-radius: var(--r-full); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); }
.flashcard__frente { flex: 1; }
.flashcard[data-visto] .flashcard__n { background: var(--ok-soft); color: var(--ok); }

/* ------------------------------------------------------------- Leitor */
/* Marca-texto, ajustes de leitura ("Aa") e Meus destaques. Contrato em docs/leitor.md. */

/* Ajustes de leitura: escala, fonte, espaçamento e largura */
.leitor .prosa { font-size: calc(1.0625rem * var(--leitura-escala, 1)); }
html[data-leitura-fonte="serifa"] .leitor .prosa {
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif; }
html[data-leitura-fonte="legivel"] .leitor .prosa {
  font-family: "Atkinson Hyperlegible", Verdana, Tahoma, sans-serif; letter-spacing: 0.01em; word-spacing: 0.06em; }
html[data-leitura-espaco="compacto"] .leitor .prosa { line-height: 1.5; }
html[data-leitura-espaco="normal"] .leitor .prosa { line-height: 1.7; }
html[data-leitura-espaco="amplo"] .leitor .prosa { line-height: 1.95; }
html[data-leitura-espaco="amplo"] .leitor .prosa p { margin-bottom: var(--s4); }
html[data-leitura-largura="estreita"] { --largura-leitura: 60ch; }
html[data-leitura-largura="media"] { --largura-leitura: 72ch; }
html[data-leitura-largura="larga"] { --largura-leitura: 88ch; }

/* Temas: sobrepõem o sistema. Claro e sépia usam a paleta clara; escuro e preto, a escura */
html[data-leitura-tema="claro"], html[data-leitura-tema="sepia"] {
  color-scheme: light;
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #eef1f5; --text: #16202e; --text-2: #4a5568;
  --border: #dde1e7; --border-strong: #7c8698; --primary: #1d4ed8; --primary-hover: #1e40af;
  --on-primary: #ffffff; --primary-soft: #e8efff; --primary-text: #1e40af; --focus: #1d4ed8;
  --ok: #166534; --ok-soft: #e3f4e8; --warn: #8a4b08; --warn-soft: #fdf1dc;
  --danger: #b42318; --danger-soft: #fdecea;
  --ramo-1: #1d4ed8; --ramo-2: #0f766e; --ramo-3: #6d28d9; --ramo-4: #b45309; --ramo-5: #be123c; --ramo-6: #15803d;
  --shadow-1: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
  --shadow-2: 0 4px 12px rgb(16 24 40 / 10%);
}
html[data-leitura-tema="sepia"] {
  --bg: #f4ecd8; --surface: #fbf5e6; --text: #3b2f1e; --border: #e0d3b5;
  --surface-2: color-mix(in srgb, var(--surface) 90%, var(--text));
  --text-2: color-mix(in srgb, var(--text) 75%, var(--surface));
  --border-strong: color-mix(in srgb, var(--text) 45%, var(--surface));
}
html[data-leitura-tema="escuro"], html[data-leitura-tema="preto"] {
  color-scheme: dark;
  --bg: #0f141a; --surface: #171d25; --surface-2: #202833; --text: #e8ecf1; --text-2: #a8b2c0;
  --border: #2d3642; --border-strong: #6b7686; --primary: #8ab4ff; --primary-hover: #a9c7ff;
  --on-primary: #0b1426; --primary-soft: #1c2a44; --primary-text: #a9c7ff; --focus: #8ab4ff;
  --ok: #7ee2a0; --ok-soft: #16301f; --warn: #f3c26b; --warn-soft: #352812;
  --danger: #ff9b8f; --danger-soft: #3a1c19;
  --ramo-1: #8ab4ff; --ramo-2: #5eead4; --ramo-3: #c4b5fd; --ramo-4: #fcd34d; --ramo-5: #fda4af; --ramo-6: #86efac;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow-2: 0 4px 12px rgb(0 0 0 / 45%);
}
html[data-leitura-tema="preto"] {
  --bg: #000; --surface: #0b0b0b; --text: #d6d6d6;
  --surface-2: color-mix(in srgb, var(--surface), var(--text) 12%);
  --text-2: color-mix(in srgb, var(--text) 70%, var(--surface));
  --border: color-mix(in srgb, var(--surface), var(--text) 16%);
  --border-strong: color-mix(in srgb, var(--surface), var(--text) 40%);
}

/* Marca-texto: cores de significado (cada uma com sublinhado próprio) */
mark.destaque {
  --marca: 250 204 21; --marca-alfa: 45%;
  background: rgb(var(--marca) / calc(var(--marca-alfa) + var(--marca-reforco, 0%)));
  color: inherit; border-radius: 2px; cursor: pointer;
  /* .destaque (termo grifado das questões reais) é negrito sublinhado: não vale aqui */
  font-weight: inherit; text-decoration: none;
  box-decoration-break: clone; -webkit-box-decoration-break: clone; text-underline-offset: 3px;
}
mark.destaque--amarelo { --marca: 250 204 21; --marca-alfa: 45%; }
mark.destaque--vermelho { --marca: 248 113 113; --marca-alfa: 40%; text-decoration: underline wavy rgb(248 113 113); }
mark.destaque--verde { --marca: 74 222 128; --marca-alfa: 35%; text-decoration: underline dotted rgb(74 222 128); }
mark.destaque--azul { --marca: 96 165 250; --marca-alfa: 38%; text-decoration: underline dashed rgb(96 165 250); }
mark.destaque:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.destaque--nota.destaque--fim::after { content: "✎"; font-size: 0.7em; vertical-align: super; margin-left: 2px; color: var(--text-2); }
/* Em fundo escuro, os mesmos destaques ficam um pouco mais fortes */
html[data-leitura-tema="escuro"], html[data-leitura-tema="preto"] { --marca-reforco: 15%; }
@media (prefers-color-scheme: dark) {
  html:not([data-leitura-tema]), html[data-leitura-tema="auto"] { --marca-reforco: 15%; }
}

/* Barra de ferramentas (fixa abaixo do cabeçalho) */
.leitor [hidden], .marcador[hidden], .marcador [hidden] { display: none !important; }
.leitor__barra { position: sticky; top: 56px; z-index: 12; background: var(--bg); display: flex; flex-wrap: wrap;
  align-items: center; gap: var(--s2); padding: var(--s2) 0; }
.leitor__restante { margin-right: auto; font-variant-numeric: tabular-nums; }
.leitor__so-movel { display: none; }
@media (max-width: 720px) { .leitor__barra { top: 52px; } }
@media (max-width: 960px) {
  .leitor__so-movel { display: inline-flex; }
  /* Celular: uma linha só, botões justos, e a barra some ao descer (volta ao subir). */
  .leitor__barra { flex-wrap: nowrap; gap: var(--s1); transition: transform var(--dur) ease-out; }
  .leitor__barra .btn--sm { padding: 0 var(--s2); }
  .leitor__restante { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .leitor__barra--oculta { transform: translateY(calc(-100% - 60px)); }
}
@media (max-width: 520px) {
  .leitor__so-largo { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Na leitura, "Concluí" fica no fim do texto, não preso na tela por cima dele. */
.leitor ~ .barra-acao { position: static; background: none; backdrop-filter: none; }

/* Painel de ajustes ("Aa") */
.leitor__painel { display: grid; gap: var(--s3); padding: var(--s4); margin: 0 0 var(--s4); }
.leitor__grupo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-width: 0; margin: 0;
  padding: 0; border: 0; }
.leitor__grupo output { min-width: 3.5em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.leitor__rotulo { min-width: 72px; padding: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
legend.leitor__rotulo { float: left; margin-right: var(--s2); }
.leitor__opcao { position: relative; display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap);
  padding: 0 var(--s3); border: 1px solid var(--border-strong); border-radius: var(--r-full); background: var(--surface);
  color: var(--text); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.leitor__opcao input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.leitor__opcao:has(input:checked) { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary); }
.leitor__opcao:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.leitor__retomar { flex-wrap: wrap; align-items: center; margin-bottom: var(--s4); }
.leitor__retomar p { margin: 0; flex: 1 1 200px; }

/* Modo foco: sem menus, texto centrado */
html[data-leitura-foco] .app-header, html[data-leitura-foco] .tabbar,
html[data-leitura-foco] .page-head, html[data-leitura-foco] .toc { display: none; }
html[data-leitura-foco] .leitura-layout { grid-template-columns: minmax(0, 1fr); max-width: var(--largura-leitura); margin: 0 auto; }
html[data-leitura-foco] .leitor__barra { top: 0; }

/* Índice: gaveta embaixo no celular (abaixo de 960px, acima da tabbar) */
.toc a[aria-current="true"] { border-left-color: var(--primary); color: var(--text); font-weight: 600; }
@media (max-width: 960px) {
  .toc.toc--aberto { display: block; position: fixed; inset: auto 0 0 0; z-index: 35; max-height: 70vh; overflow: auto;
    background: var(--surface); border-top: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: var(--shadow-2); padding: var(--s4); }
}
@media (max-width: 720px) { .toc.toc--aberto { bottom: calc(58px + env(safe-area-inset-bottom)); } }

/* Marca-texto: barra flutuante e botões de cor */
.marcador { position: absolute; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 2px; max-width: calc(100vw - 16px); padding: var(--s1); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.marcador__cor { --swatch: #facc15; position: relative; flex: none; display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; min-width: var(--tap); min-height: var(--tap);
  padding: 2px var(--s1); border: 0; border-radius: var(--r-md); background: transparent; color: var(--text);
  font: inherit; cursor: pointer; }
.marcador__cor::before { content: ""; width: 26px; height: 26px; border-radius: 50%; background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 20%); flex: none; }
.marcador__cor:hover { background: var(--surface-2); }
.marcador__rotulo { font-size: 11px; font-weight: 600; line-height: 1.1; white-space: nowrap; color: var(--text-2); }
.marcador__cor[aria-pressed="true"] .marcador__rotulo { color: var(--text); }
.marcador__cor--vermelho { --swatch: #f87171; }
.marcador__cor--verde { --swatch: #4ade80; }
.marcador__cor--azul { --swatch: #60a5fa; }
.marcador__cor[aria-pressed="true"]::before { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text); }
.marcador__cor:focus-visible, .marcador__acao:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.marcador__acao { min-height: var(--tap); padding: 0 var(--s3); border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--primary-text); font: inherit; font-size: var(--fs-sm); font-weight: 600;
  cursor: pointer; }
.marcador__acao:hover { background: var(--surface-2); }
.marcador__acao--perigo { color: var(--danger); }

/* Diálogo de nota */
dialog.dialogo-nota { width: min(32rem, 100vw - 32px); max-width: none; }
dialog.dialogo-nota::backdrop { background: rgb(0 0 0 / 45%); }
.dialogo-nota__trecho { margin: 0 0 var(--s3); padding: var(--s2) var(--s4); background: var(--primary-soft);
  border-left: 4px solid var(--primary); border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.dialogo-nota label { display: block; margin-top: var(--s3); font-weight: 600; font-size: var(--fs-sm); }
.dialogo-nota textarea { display: block; width: 100%; margin-top: var(--s1); padding: var(--s2) var(--s3);
  border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text);
  font: inherit; resize: vertical; }
.dialogo-nota .row { justify-content: flex-end; margin-top: var(--s4); }

/* Meus destaques: filtro por cor e cartões */
.filtros-cor { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s4); }
a.chip { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4);
  border: 1px solid var(--border-strong); border-radius: var(--r-full); background: var(--surface); color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
a.chip:hover { background: var(--surface-2); color: var(--text); }
a.chip[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary); }
.badge--neutro { background: var(--surface-2); color: var(--text-2); }
.destaque-item { --cor: var(--border-strong); display: grid; gap: var(--s2); padding: var(--s3) var(--s4);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--cor); border-radius: var(--r-lg); }
.destaque-item + .destaque-item { margin-top: var(--s3); }
.destaque-item--amarelo { --cor: #facc15; }
.destaque-item--vermelho { --cor: #f87171; }
.destaque-item--verde { --cor: #4ade80; }
.destaque-item--azul { --cor: #60a5fa; }
.destaque-item__trecho { margin: 0; line-height: var(--lh-reading); }
.destaque-item__nota { margin: 0; font-style: italic; color: var(--text-2); }
.destaque-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3);
  font-size: var(--fs-xs); color: var(--text-2); }

/* Impressão: sem ferramentas, mas com as cores do marca-texto */
@media print {
  .leitor__barra, .leitor__painel, .leitor__retomar, .marcador, .toc { display: none !important; }
  mark.destaque { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Sem movimento: nada de transições no leitor */
@media (prefers-reduced-motion: reduce) {
  .leitor *, .marcador * { transition: none !important; animation: none !important; }
}


/* ------------------------------------------------------- Página inicial (landing) */
/* A landing é a única página com cabeçalho e rodapé próprios: ela aparece só para quem
   não entrou. O herói e a oferta usam o marinho da marca; o resto segue os tokens. */
.html--lp main { max-width: none; padding: 0; }
.lp-wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--s5); }
.lp-topo { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.lp-topo__in { display: flex; align-items: center; gap: var(--s5); min-height: 68px; }
.lp-nav { display: flex; gap: 2px; }
.lp-nav a { color: var(--text-2); text-decoration: none; font-weight: 600; font-size: var(--fs-sm);
  padding: 10px 12px; border-radius: var(--r-md); }
.lp-nav a:hover { background: var(--surface-2); color: var(--text); }
.lp-topo__acoes { margin-left: auto; display: flex; gap: var(--s2); }
.lp-topo__acoes .btn { min-height: 44px; padding: 0 18px; font-size: var(--fs-sm); }

.lp-heroi { background: var(--marca); color: var(--on-marca); padding: 88px 0 72px; position: relative; overflow: hidden;
  color-scheme: dark; }
.lp-heroi::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgb(255 255 255 / 7%) 1px, transparent 0); background-size: 28px 28px; }
.lp-heroi__grade { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; align-items: center; }
.lp-heroi__texto { display: flex; flex-direction: column; gap: var(--s5); }
.lp-heroi h1 { font-size: clamp(2.25rem, 4.2vw, 3.5rem); font-weight: 800; color: #fff; line-height: 1.1; }
.lp-heroi__sub { font-size: 1.1875rem; line-height: 1.55; color: var(--on-marca-2); max-width: 560px; margin: 0; }
.lp-heroi__nota { font-size: var(--fs-sm); color: #93a3c0; margin: 0; }
.lp-selo { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; padding: 8px 14px 8px 10px;
  border-radius: var(--r-full); background: rgb(245 158 11 / 14%); border: 1px solid rgb(245 158 11 / 45%);
  color: #fbbf24; font-weight: 700; font-size: var(--fs-sm); }
.lp-selo__ponto { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; }
.lp-cta { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }

.lp-previa { background: #fff; color: #0f172a; border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow-3);
  border: 1px solid rgb(255 255 255 / 20%); display: flex; flex-direction: column; gap: var(--s4); color-scheme: light; }
.lp-previa .muted { color: #526071; }
.lp-previa__topo { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.lp-previa__titulo { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.lp-previa__proxima { border: 2px solid #1d4ed8; border-radius: 14px; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.lp-previa__proxima .btn { margin-top: 6px; background: #1d4ed8; color: #fff; }
.lp-previa__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #1e40af; }
.lp-previa__nome { font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; }
.lp-previa__lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); font-size: var(--fs-sm); }
.lp-previa__lista li { display: flex; gap: 10px; align-items: center; }
.lp-previa__icone { width: 26px; height: 26px; border-radius: 8px; background: #eef2f8; display: grid; place-items: center; color: #1e40af; flex: none; }
.lp-previa__icone .icon { width: 16px; height: 16px; }
.lp-previa__proj { border-top: 1px solid #e3e8ef; padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.lp-previa .meter { background: #eef2f8; }
.lp-previa .meter__faixa { background: #dbe6fd; box-shadow: inset 0 0 0 1px #1d4ed8; }
.lp-previa .meter__ponto { background: #1d4ed8; border-color: #fff; }
.lp-previa .meter__min { background: #0f172a; }

.lp-faixa { background: var(--marca-2); color: #dce4f2; border-top: 1px solid rgb(255 255 255 / 8%); }
.lp-faixa__in { display: flex; flex-wrap: wrap; gap: var(--s3) 36px; align-items: center; min-height: 64px;
  padding-top: var(--s3); padding-bottom: var(--s3); font-size: var(--fs-sm); font-weight: 600; }
.lp-faixa__k { color: #93a3c0; font-weight: 500; margin-right: 4px; }

.lp-secao { padding: 88px 0; }
.lp-secao--justa { padding-top: 0; }
.lp-secao--branca { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lp-cabeca { max-width: 720px; display: flex; flex-direction: column; gap: var(--s4); margin-bottom: 40px; }
.lp-cabeca h2 { font-size: clamp(1.75rem, 3vw, 2.375rem); font-weight: 700; }
.lp-cabeca p { font-size: 1.0625rem; line-height: 1.6; color: var(--text-2); margin: 0; }
.lp-cabeca .btn { align-self: flex-start; }
.lp-cabeca--fixa { position: sticky; top: 96px; margin-bottom: 0; }
.lp-cabeca--linha { flex-direction: row; align-items: baseline; justify-content: space-between; max-width: none; margin-bottom: var(--s4); }
.lp-cabeca--linha h2 { font-size: 1.25rem; }
.lp-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-text); }
.lp-eyebrow--ambar { color: var(--acento-text); }
.lp-eyebrow--claro { color: #fbbf24; }
.lp-grade { display: grid; gap: var(--s5); }
.lp-grade--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; }
.lp-grade--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lp-grade--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.lp-grade--topo { align-items: start; }

.lp-stat { display: flex; flex-direction: column; gap: 6px; border-radius: var(--r-xl); }
.lp-stat__n { font-family: var(--font-display); font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--marca); }
@media (prefers-color-scheme: dark) { .lp-stat__n { color: var(--text); } }
.lp-dif { display: flex; flex-direction: column; gap: var(--s3); border-radius: var(--r-xl); }
.lp-dif h3 { font-size: 1.25rem; }
.lp-dif p { color: var(--text-2); line-height: 1.6; margin: 0; }
.lp-dif__icone { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.lp-dif__icone .icon { width: 24px; height: 24px; }
.lp-dif__icone--azul { background: var(--primary-soft); color: var(--primary-text); }
.lp-dif__icone--ambar { background: var(--warn-soft); color: var(--acento-text); }
.lp-dif__icone--verde { background: var(--ok-soft); color: var(--ok); }

.lp-passos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s6); }
.lp-passos li { display: grid; grid-template-columns: 48px 1fr; gap: var(--s5); }
.lp-passos h3 { font-size: 1.25rem; margin-bottom: 6px; }
.lp-passos p { color: var(--text-2); line-height: 1.6; margin: 0; }
.lp-passos__n { width: 48px; height: 48px; border-radius: 50%; background: var(--marca); color: var(--acento); display: grid;
  place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.125rem; }

.lp-tabela th[scope="col"] { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; background: var(--surface-2); }
.lp-tabela th, .lp-tabela td { padding: 14px 16px; font-size: var(--fs-md); }
.lp-tabela th[scope="row"] { font-weight: 700; }
.lp-tabela__total th, .lp-tabela__total td { background: var(--surface-2); font-weight: 700; }
.lp-fonte { margin-top: var(--s3); }

.lp-oferta { background: var(--marca); color: var(--on-marca); padding: 88px 0; color-scheme: dark; }
.lp-oferta__texto { display: flex; flex-direction: column; gap: var(--s4); }
.lp-oferta h2 { font-size: clamp(1.875rem, 3.2vw, 2.5rem); font-weight: 800; color: #fff; }
.lp-oferta__texto p { font-size: 1.0625rem; line-height: 1.6; color: var(--on-marca-2); margin: 0; }
.lp-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-md); }
.lp-lista li { display: flex; gap: 10px; align-items: flex-start; }
.lp-lista .icon { color: #fbbf24; margin-top: 2px; }
.lp-form { background: #fff; color: #0f172a; display: flex; flex-direction: column; gap: var(--s4); padding: var(--s6);
  border-radius: var(--r-xl); color-scheme: light; }
.lp-form h3 { font-size: 1.375rem; }
.lp-form .muted { color: #526071; }
.lp-form .campo label { color: #0f172a; }
.lp-form .campo input, .lp-form .campo select { background: #fff; color: #0f172a; }
.lp-form .aceite { color: #334155; }
.lp-form__ja { text-align: center; margin: 0; }

.lp-faq { border-top: 1px solid var(--border); }
.lp-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  gap: var(--s4); padding: 20px 0; font-weight: 700; font-size: 1.0625rem; font-family: var(--font-display); letter-spacing: -0.01em; min-height: var(--tap); }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary .icon { transition: transform var(--dur); }
.lp-faq[open] summary .icon { transform: rotate(45deg); }
.lp-faq p { padding: 0 0 20px; color: var(--text-2); line-height: 1.6; max-width: 760px; margin: 0; }

.lp-final { border-radius: 24px; padding: var(--s7); display: flex; flex-wrap: wrap; gap: var(--s5); align-items: center; justify-content: space-between; }
.lp-final h2 { font-size: clamp(1.5rem, 2.6vw, 1.875rem); margin-bottom: var(--s2); }
.lp-final p { margin: 0; }
.lp-final > div { max-width: 620px; }

.lp-rodape { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0; color: var(--text-2); font-size: var(--fs-sm); }
.lp-rodape__in { display: flex; flex-wrap: wrap; gap: var(--s5) 40px; justify-content: space-between; align-items: flex-start; }
.lp-rodape__marca { display: flex; flex-direction: column; gap: var(--s2); max-width: 460px; }
.lp-rodape__links { display: flex; gap: var(--s5); flex-wrap: wrap; }
.lp-rodape__links a { color: var(--text); text-decoration: none; font-weight: 600; padding: var(--s2) 0; }

@media (max-width: 900px) {
  .lp-heroi__grade, .lp-grade--2, .lp-grade--3, .lp-grade--4 { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .lp-nav, .lp-oculto-m { display: none; }
  .lp-wrap { padding: 0 var(--s4); }
  .lp-heroi, .lp-secao, .lp-oferta { padding: 56px 0; }
  .lp-secao--justa { padding-top: 0; }
  .lp-cta { flex-direction: column; align-items: stretch; }
  .lp-cta .btn { width: 100%; }
  .lp-cabeca--fixa { position: static; margin-bottom: var(--s5); }
  .lp-stat__n { font-size: 2.5rem; }
  .lp-final { padding: var(--s5); }
  .lp-topo__in { gap: var(--s3); }
  /* Quem já tem conta acha o "Entrar" no topo também no celular */
  .lp-topo__acoes .btn { padding: 0 var(--s3); }
}

/* ------------------------------------------------------------- Página de erro */
.erro { max-width: 560px; margin: var(--s6) auto 0; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: var(--s3); }
.erro__marca { justify-content: center; margin: var(--s4) auto 0; width: fit-content; }
.erro__codigo { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 3rem; line-height: 1;
  color: var(--text-2); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.erro h1 { font-size: var(--fs-xl); }
.erro__texto { color: var(--text-2); margin: 0; max-width: 48ch; }
.erro .notice { text-align: left; width: 100%; }
.erro__acoes { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin-top: var(--s2); width: 100%; }
@media (max-width: 480px) { .erro__acoes .btn { flex: 1 1 100%; } }

/* ------------------------------------------------------ Menu secundário (⋯) */
/* Ações raras e destrutivas (ex.: descartar a atividade) ficam atrás de um toque a mais. */
.menu-sec { position: relative; }
.menu-sec > summary { list-style: none; width: var(--tap); padding: 0; color: var(--text-2); }
.menu-sec > summary::-webkit-details-marker { display: none; }
.menu-sec[open] > summary { background: var(--surface-2); color: var(--text); }
.menu-sec__lista { position: absolute; right: 0; top: calc(100% + var(--s1)); z-index: 25; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-2);
  padding: var(--s1); }
.menu-sec__item { display: flex; align-items: center; width: 100%; min-height: var(--tap); padding: 0 var(--s3);
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font: inherit; font-weight: 600;
  text-align: left; cursor: pointer; }
.menu-sec__item:hover { background: var(--surface-2); }
.menu-sec__item--perigo { color: var(--danger); }
@media (max-width: 720px) {
  .page-head:has(> .menu-sec) .page-head__eyebrow { padding-right: 52px; }
  .menu-sec.page-head__acao { position: absolute; top: 0; right: calc(-1 * var(--s2)); padding: 0; }
}

/* ----------------------------------------------- Rascunho das respostas */
.rascunho-aviso { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1) var(--s3);
  margin-bottom: var(--s3); padding: var(--s1) var(--s1) var(--s1) var(--s4); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); }

/* ----------------------------------------------- Cartões: autoavaliação */
.flashcard__verso > p { margin: 0 0 var(--s3); }
.flashcard__selo { display: block; margin-top: var(--s1); font-size: var(--fs-xs); font-weight: 700; color: var(--warn); }
.autoavaliacao { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding-top: var(--s3);
  border-top: 1px dashed var(--border); }
.autoavaliacao[hidden] { display: none; }
.autoavaliacao__pergunta { flex-basis: 100%; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.autoavaliacao .btn { flex: 1 1 120px; }
.autoavaliacao [data-sabia="1"][aria-pressed="true"] { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.autoavaliacao [data-sabia="0"][aria-pressed="true"] { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.autoavaliacao__erro { flex-basis: 100%; font-size: var(--fs-sm); color: var(--danger); }
.flashcard[data-avaliado="sim"] .flashcard__n { background: var(--ok-soft); color: var(--ok); }
.flashcard[data-avaliado="nao"] .flashcard__n { background: var(--danger-soft); color: var(--danger); }

/* ----------------------------------------------- Caderno de erros por tópico */
.erros-topico { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.erros-topico + .erros-topico { margin-top: var(--s2); }
.erros-topico > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s3);
  min-height: 56px; padding: var(--s3) var(--s4); font-weight: 600; }
.erros-topico > summary::-webkit-details-marker { display: none; }
.erros-topico > summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2); transform: rotate(45deg); transition: transform var(--dur); }
.erros-topico[open] > summary::after { transform: rotate(225deg); }
.erros-topico__titulo { flex: 1; min-width: 0; }
.erros-topico__n { flex: none; font-size: var(--fs-sm); font-weight: 700; color: var(--danger); background: var(--danger-soft);
  border-radius: var(--r-full); padding: 2px 10px; }
.erros-topico__corpo { padding: 0 var(--s3) var(--s3); }
.erros-topico__corpo > p a { display: inline-block; padding: var(--s2) 0; }
.base--apoio { margin: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ----------------------------------------------- Tópico sem material */
.sem-material h2 { font-size: var(--fs-lg); margin-bottom: var(--s3); }
.sem-material__lista { margin: 0 0 var(--s3); display: grid; gap: var(--s2); }
.sem-material__lista dt { font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); }
.sem-material__lista dd { margin: 0; }
.sem-material .notice { margin-bottom: var(--s3); }

/* ----------------------------------------------- Enunciado: comando depois das assertivas */
.comando { display: block; margin-top: var(--s2); }
.base__titulo { display: block; font-weight: 700; margin-bottom: var(--s1); }
.base__fonte { display: block; margin-top: var(--s2); font-size: var(--fs-sm); color: var(--text-2); }
.sem-material { margin-bottom: var(--s5); }
