/* Suporte Vupth — o visual do app, lido de fontes/design/tokens.json do vupth-docs
   (DEC-116; a cópia usada pelo teste está em tests/tokens.json). Claro e escuro
   seguem o sistema. Nenhuma cor, fonte ou espaço próprio: tests/tema.test.js
   compara este arquivo com o tokens.json e mede os pares de contraste. */
@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@700;800&family=DM+Mono:wght@500&family=Inter:wght@400;500;600&display=swap");

:root {
  color-scheme: light dark;
  /* cores — tema claro */
  --brand-green: #9FE870;
  --on-green: #163300;
  --green-tint: #E2F6D5;
  --on-green-tint: #163300;
  --bg: #FFFFFF;
  --surface: #F3F5F1;
  --surface-alt: #E2F6D5;
  --text-primary: #163300;
  --text-secondary: #454745;
  --text-placeholder: #6B706B;
  --border: #D7DDD3;
  --danger: #B3261E;
  --danger-tint: #F7E4E2;
  --foco: rgba(22, 51, 0, .15);
  --sombra: rgba(0, 0, 0, .2);

  /* fontes */
  --font-heading: "Archivo", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;

  /* raios */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-card: 20px;
  --radius-hero: 24px;
  --radius-full: 999px;

  /* tamanhos (escala de texto) */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-xxl: 28px;
  --fs-xxxl: 34px;

  /* espaços */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --brand-green: #9FE870;
    --on-green: #163300;
    --green-tint: #223D0D;
    --on-green-tint: #9FE870;
    --bg: #0B1A04;
    --surface: #163300;
    --surface-alt: #1F3F0B;
    --text-primary: #F3F5F1;
    --text-secondary: #B5C2AB;
    --text-placeholder: #8A978A;
    --border: #5C8A3A;
    --danger: #FFB4AB;
    --danger-tint: #4A1A16;
    --foco: rgba(159, 232, 112, .35);
    --sombra: rgba(0, 0, 0, .55);
  }
}
:root[data-tema="claro"] { color-scheme: light; }
:root[data-tema="escuro"] {
  color-scheme: dark;
  --brand-green: #9FE870;
  --on-green: #163300;
  --green-tint: #223D0D;
  --on-green-tint: #9FE870;
  --bg: #0B1A04;
  --surface: #163300;
  --surface-alt: #1F3F0B;
  --text-primary: #F3F5F1;
  --text-secondary: #B5C2AB;
  --text-placeholder: #8A978A;
  --border: #5C8A3A;
  --danger: #FFB4AB;
  --danger-tint: #4A1A16;
  --foco: rgba(159, 232, 112, .35);
  --sombra: rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font: 400 var(--fs-md)/1.55 var(--font-body);
}
a { color: var(--text-primary); text-underline-offset: 2px; }
b, strong { font-weight: 600; }
h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.4px;
  margin: 0 0 var(--sp-2);
}
h1 { font-weight: 800; }   /* display */
h2, h3 { font-weight: 700; } /* heading */

/* Página inicial: o herói lima com a busca */
.topo {
  background: var(--brand-green);
  padding: var(--sp-12) var(--sp-4) var(--sp-8);
  text-align: center;
  border-radius: 0 0 var(--radius-hero) var(--radius-hero);
}
.topo .marca img { vertical-align: -.2em; }
.topo .marca {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: .18em;
  font-size: var(--fs-sm);
  margin: 0 0 var(--sp-3);
}
.topo h1, .topo .marca, .topo a { color: var(--on-green); }
.topo h1 { font-size: clamp(var(--fs-xxl), 7vw, var(--fs-xxxl)); }
.busca { max-width: 640px; margin: var(--sp-4) auto 0; }
.busca input {
  width: 100%;
  padding: var(--sp-4) var(--sp-4);
  border-radius: var(--radius-full);
  border: 2px solid var(--text-primary);
  font: 400 var(--fs-lg) var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
}
.busca input::placeholder { color: var(--text-placeholder); }
.busca input:focus { box-shadow: 0 0 0 4px var(--foco); }

.conteudo { max-width: 860px; margin: 0 auto; padding: var(--sp-8) var(--sp-4) var(--sp-12); }
.categorias { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-3); }
.categoria { background: var(--surface); border-radius: var(--radius-card); padding: var(--sp-4) var(--sp-4); }
.categoria h2 { font-size: var(--fs-lg); }
.categoria ul { list-style: none; padding: 0; margin: 0; }
.categoria li { margin: var(--sp-2) 0; }
.categoria a { text-decoration: none; }
.categoria a:hover { text-decoration: underline; }

.conteudo > section > h2 { font-size: var(--fs-xl); }
.resultados { list-style: none; padding: 0; margin: 0; }
.resultados li { padding: var(--sp-4) 0; border-bottom: 1px solid var(--border); }
.resultados a { font-weight: 600; font-size: var(--fs-lg); }
.resultados p { margin: var(--sp-1) 0 0; color: var(--text-secondary); }
.publico {
  display: inline-block;
  color: var(--on-green-tint);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--green-tint);
  border-radius: var(--radius-full);
  padding: 1px var(--sp-2);
  margin-left: var(--sp-2);
  vertical-align: middle;
}
.vazio { color: var(--text-secondary); }

/* Artigo */
.artigo { max-width: 720px; margin: 0 auto; padding: var(--sp-6) var(--sp-4) var(--sp-12); }
.trilha { font-size: var(--fs-sm); color: var(--text-secondary); margin: 0 0 var(--sp-4); }
.artigo h1 { font-size: clamp(var(--fs-xl), 6vw, var(--fs-xxl)); }
.artigo .resumo { color: var(--text-secondary); font-size: var(--fs-lg); margin-top: 0; }
.artigo h2 { font-size: var(--fs-xl); margin-top: var(--sp-8); }
.artigo ol, .artigo ul { padding-left: 1.3em; }
.artigo li { margin: var(--sp-2) 0; }
.artigo ol li::marker { font-family: var(--font-mono); color: var(--text-secondary); }
.dica { background: var(--green-tint); color: var(--on-green-tint); border-radius: var(--radius-xl); padding: var(--sp-3) var(--sp-4); }
.atencao { background: var(--danger-tint); color: var(--danger); border-radius: var(--radius-xl); padding: var(--sp-3) var(--sp-4); }
.ajuda { margin-top: var(--sp-8); padding-top: var(--sp-4); border-top: 1px solid var(--border); color: var(--text-secondary); }

.rodape { text-align: center; color: var(--text-secondary); font-size: var(--fs-sm); padding: var(--sp-6) var(--sp-4) var(--sp-8); }

/* Índice lateral e "Antes disso" (SUP-2, SUP-4) */
.antes { background: var(--surface); border-radius: var(--radius-xl); padding: var(--sp-3) var(--sp-4); margin: var(--sp-4) 0; }
.indice { position: fixed; top: var(--sp-4); right: var(--sp-4); width: 240px; max-height: 80vh; overflow: auto;
  background: var(--surface); border-radius: var(--radius-xl); padding: var(--sp-3); font-size: var(--fs-sm); z-index: 10; }
.indice ul { list-style: none; margin: var(--sp-2) 0 0; padding: 0; }
.indice li { margin: var(--sp-1) 0; border-left: 3px solid transparent; padding-left: var(--sp-2); }
.indice li.sub { margin-left: var(--sp-3); }
.indice li.atual { border-left-color: var(--brand-green); font-weight: 600; }
.indice a { text-decoration: none; }
.indice.fechado ul { display: none; }
/* Laterais estilo Render (laterais-estilo-render): até a base da tela; recolhidas, coluna de ícones; controle no pé */
.trilho { display: none; }
.chip { display: flex; align-items: center; justify-content: center; width: 40px; height: 34px; margin: 0 auto var(--sp-1); border: 0; border-radius: var(--radius-lg);
  background: none; color: var(--text-secondary); font: 600 var(--fs-sm) var(--font-body); text-decoration: none; cursor: pointer; }
.chip:hover, .chip:focus-visible { background: var(--green-tint); color: var(--on-green-tint); }
/* Botão das laterais igual ao do vupth-docs (.lado-btn): quadrado de 28px, borda fina, ícone de painel; o rótulo só aparece na gaveta (tela estreita) */
.lado-rodape { position: sticky; bottom: 0; margin-top: auto; display: flex; padding: var(--sp-2) 0 var(--sp-1); background: var(--surface); border-top: 1px solid var(--border); }
.lado-ctl { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-width: 28px; height: 28px; padding: 0; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--surface); color: var(--text-secondary); font: 600 var(--fs-sm) var(--font-body); cursor: pointer; }
.lado-ctl:hover, .lado-ctl:focus-visible { color: var(--text-primary); border-color: var(--text-secondary); }
.lado-ctl .ico { display: inline-flex; }
.lado-rodape.dir .lado-ctl svg { transform: scaleX(-1); }
.lado-ctl .rot { display: none; }
@media (max-width: 1099px) { .lado-ctl { padding: 0 var(--sp-3); } .lado-ctl .rot { display: inline; } }
.lado-abrir { position: fixed; bottom: var(--sp-3); z-index: 10; padding: var(--sp-2) var(--sp-3); border: 2px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-primary); font: 600 var(--fs-sm) var(--font-body); cursor: pointer; }
.lado-abrir[hidden] { display: none; }
.lado-abrir.esq { left: var(--sp-3); }
.lado-abrir.dir { right: var(--sp-3); }
.indice, .arvore { display: flex; flex-direction: column; }
@media (min-width: 1100px) {
  .indice { top: 0; bottom: 0; right: 0; max-height: none; border-radius: 0; border-left: 1px solid var(--border); }
  .indice.fechado { width: 56px; padding: var(--sp-3) var(--sp-2) 0; overflow: hidden; }
  .indice.fechado .trilho { display: block; }
  .indice.fechado .lado-rodape { justify-content: center; }
  .lado-abrir.dir { display: none; }
}
@media (max-width: 1099px) {
  .indice { top: 0; bottom: 0; right: 0; width: min(300px, 85vw); max-height: none; border-radius: 0; border-left: 1px solid var(--border); box-shadow: 0 0 24px var(--sombra); z-index: 20; }
  .indice.fechado { display: none; }
}

/* Home por perfil e abas de categoria (SUP-12, SUP-4) */
.perfil { display: block; color: inherit; text-decoration: none; }
.perfil:hover h2 { text-decoration: underline; }
.perfil p { margin: var(--sp-1) 0 0; color: var(--text-secondary); }
.abas { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-4); }
.abas a { padding: var(--sp-2) var(--sp-4); border-radius: 999px; border: 2px solid var(--border); text-decoration: none; font-size: var(--fs-sm); }
.abas a[aria-current="page"] { background: var(--green-tint); color: var(--on-green-tint); border-color: var(--text-primary); font-weight: 600; }

/* Navegação como a documentação do Expo (indice-como-expo) */
.arvore { position: fixed; top: var(--sp-4); left: var(--sp-4); width: 250px; max-height: 88vh; overflow: auto;
  background: var(--surface); border-radius: var(--radius-xl); padding: var(--sp-3); font-size: var(--fs-sm); z-index: 10; }
.arvore.fechado .arvore-corpo { display: none; }
@media (min-width: 1280px) {
  .arvore { top: 0; bottom: 0; left: 0; max-height: none; border-radius: 0; border-right: 1px solid var(--border); }
  .arvore.fechado { width: 56px; padding: var(--sp-3) var(--sp-2) 0; overflow: hidden; }
  .arvore.fechado .trilho { display: block; }
  .arvore.fechado .lado-rodape { justify-content: center; }
  .lado-abrir.esq { display: none; }
}
.arvore .atalhos { margin: var(--sp-2) 0; color: var(--text-secondary); }
.arvore details { margin: var(--sp-1) 0; }
.arvore summary { cursor: pointer; font-weight: 600; padding: var(--sp-1) 0; }
.arvore ul { list-style: none; margin: 0; padding: 0 0 0 var(--sp-3); }
.arvore li { margin: var(--sp-1) 0; padding-left: var(--sp-3); position: relative; }
.arvore li.aqui::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--text-primary); }
.arvore li.aqui a { font-weight: 600; }
.arvore a { text-decoration: none; }
@media (max-width: 1279px) {
  .arvore { top: 0; bottom: 0; left: 0; width: min(300px, 85vw); max-height: none; border-radius: 0; border-right: 1px solid var(--border); box-shadow: 0 0 24px var(--sombra); z-index: 20; }
  .arvore.fechado { display: none; }
}

.cartoes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-8); }
.cartao { display: flex; flex-direction: column; gap: 2px; border: 2px solid var(--border); border-radius: var(--radius-card); padding: var(--sp-3) var(--sp-4); text-decoration: none; color: inherit; }
.cartao:hover { border-color: var(--text-primary); }
.cartao small, .cartao span { color: var(--text-secondary); font-size: var(--fs-sm); }
.cartao.prox { grid-column: 2; text-align: right; }
.cartao.ant { grid-column: 1; }
@media (max-width: 560px) { .cartoes { grid-template-columns: 1fr; } .cartao.prox { grid-column: 1; } }

.util { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--border); color: var(--text-secondary); font-size: var(--fs-sm); }
.util p { margin: 0; }
.util button { background: none; border: 2px solid var(--border); border-radius: var(--radius-full); margin-left: var(--sp-2); padding: 2px var(--sp-3); cursor: pointer; font-size: var(--fs-md); }
.util button:hover { border-color: var(--text-primary); }

/* Logotipo em todas as abas (logotipo-nas-abas) */
.topo-marca { position: relative; max-width: 860px; margin: 0 auto; padding: var(--sp-3) var(--sp-4) 0; }
.marca-link { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-heading); font-weight: 800;
  letter-spacing: .18em; font-size: var(--fs-sm); color: var(--text-primary); text-decoration: none; }
.logo-v { width: 22px; height: 19px; background: var(--text-primary); -webkit-mask: url(/marca/v.svg) center / contain no-repeat; mask: url(/marca/v.svg) center / contain no-repeat; }

/* Alternar tema (alternar-tema-claro-escuro) */
.tema-ctl { display: flex; justify-content: flex-end; gap: var(--sp-1); margin: 0 0 var(--sp-3); }
.topo { position: relative; }
.topo .tema-ctl, .topo-marca .tema-ctl { position: absolute; top: var(--sp-3); right: var(--sp-4); margin: 0; }
.tema-btn { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text-primary);
  font: 600 var(--fs-sm) var(--font-body); padding: var(--sp-1) var(--sp-3); cursor: pointer; }
.tema-btn:hover, .tema-btn:focus-visible { border-color: var(--text-secondary); }

/* Cards de campanhas ativas (cards-de-campanhas-ativas): ticket pontilhado, mockup 2 do Client (André, 24/10) */
#lista article { position: relative; background: var(--green-tint); color: var(--on-green-tint); border: 2px dashed var(--on-green-tint); border-radius: var(--radius-card); padding: var(--sp-4) var(--sp-4) var(--sp-4) 20px; margin: var(--sp-4) 10px; }
#lista article::before, #lista article::after { content: ""; position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; background: var(--bg); border: 2px dashed var(--on-green-tint); border-radius: var(--radius-full); }
#lista article::before { left: -10px; }
#lista article::after { right: -10px; }
#lista article h2 { margin: 0; font-family: var(--font-heading); font-size: var(--fs-md); }
#lista article p { margin: var(--sp-1) 0; color: inherit; font-size: var(--fs-sm); }
#lista article p.valor { font-family: var(--font-heading); font-weight: 800; font-size: var(--fs-xxl); letter-spacing: -1px; color: inherit; }
