:root {
  --verde: #14532d;
  --verde-claro: #dcfce7;
  --fundo: #f6f4ee;
  --texto: #1c1917;
  --suave: #57534e;
  --borda: #e7e5e4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #0f1a14;
    --texto: #f5f5f4;
    --suave: #a8a29e;
    --borda: #292524;
    --verde-claro: #14532d;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
.tela { min-height: 100dvh; }

/* Início e bloqueio */
.inicio { max-width: 420px; margin: 0 auto; padding: 32px 20px calc(32px + env(safe-area-inset-bottom)); text-align: center; display: flex; flex-direction: column; align-items: center; min-height: 100dvh; justify-content: center; }
.capa { width: min(62vw, 260px); aspect-ratio: 800 / 1131; object-fit: cover; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); background: var(--borda); margin-bottom: 24px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 8px; }
.sub { color: var(--suave); margin: 0 0 24px; line-height: 1.5; }
.btn { display: block; width: 100%; padding: 16px; border: 0; border-radius: 14px; background: var(--verde); color: #fff; font-size: 1.05rem; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; margin-bottom: 10px; }
.btn:active { transform: scale(.98); }
.btn-sec { background: transparent; color: var(--texto); border: 1.5px solid var(--borda); }
.btn-receita { background: var(--verde-claro); color: var(--texto); border: 1.5px solid var(--verde); }
.faixa { width: 100%; background: var(--verde-claro); color: var(--texto); padding: 10px 14px; border-radius: 12px; font-size: .92rem; margin-bottom: 16px; }
.prog-texto { color: var(--suave); font-size: .9rem; margin-top: 6px; }
.cadeado { font-size: 3.5rem; margin-bottom: 12px; }

/* Leitor */
#paginas { max-width: 760px; margin: 0 auto; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.pag { display: block; width: 100%; aspect-ratio: 800 / 1131; background: var(--borda); }
.pag img { display: block; width: 100%; height: 100%; }
.barra { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--fundo); border-top: 1px solid var(--borda); z-index: 5; }
.barra .contador { min-width: 84px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
#barra-prog { position: absolute; left: 0; top: -1px; height: 3px; width: 100%; }
#barra-prog i { display: block; height: 100%; width: 0; background: var(--verde); transition: width .2s; }
.icone { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--borda); background: transparent; color: var(--texto); font-size: 1.4rem; cursor: pointer; }
.icone:active { background: var(--verde-claro); }

/* Índice */
.topo-indice { position: sticky; top: 0; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--fundo); border-bottom: 1px solid var(--borda); z-index: 2; }
.topo-indice h2 { margin: 0; font-size: 1.1rem; }
#grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; max-width: 760px; margin: 0 auto; }
@media (min-width: 560px) { #grade { grid-template-columns: repeat(5, 1fr); } }
.mini { position: relative; border: 2px solid transparent; border-radius: 8px; overflow: hidden; padding: 0; background: var(--borda); cursor: pointer; aspect-ratio: 800 / 1131; }
.mini img { width: 100%; height: 100%; display: block; }
.mini span { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: .72rem; padding: 1px 6px; border-radius: 8px; }
.mini.atual { border-color: var(--verde); }
.mini.lida::after { content: "✓"; position: absolute; left: 4px; top: 4px; background: var(--verde); color: #fff; width: 18px; height: 18px; border-radius: 50%; font-size: .72rem; display: grid; place-items: center; }

/* Login */
.logo { width: 84px; height: 84px; border-radius: 20px; margin-bottom: 20px; }
.campo { width: 100%; padding: 16px; border: 1.5px solid var(--borda); border-radius: 14px; background: transparent; color: var(--texto); font-size: 1.2rem; text-align: center; margin-bottom: 12px; }
.campo:focus { outline: 2px solid var(--verde); border-color: transparent; }
.erro { width: 100%; background: #fee2e2; color: #7f1d1d; padding: 10px 14px; border-radius: 12px; font-size: .92rem; margin-bottom: 12px; text-align: left; }
@media (prefers-color-scheme: dark) { .erro { background: #450a0a; color: #fecaca; } }
.link { background: none; border: 0; color: var(--suave); font-size: .9rem; text-decoration: underline; cursor: pointer; padding: 12px; margin-top: 8px; }
.btn[disabled] { opacity: .6; cursor: default; }

/* Início: título só para leitores de tela (o nome já está na capa) e rótulo dos atalhos */
.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; }
.rotulo { width: 100%; display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--suave); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.rotulo::before, .rotulo::after { content: ""; flex: 1; height: 1px; background: var(--borda); }
