:root {
  --verde: #3f6b52;
  --verde-escuro: #2b4b39;
  --verde-claro: #e6efe8;
  --creme: #faf7f2;
  --texto: #23231f;
  --suave: #5f6259;
  --borda: #e3ded4;
  --alerta: #fff4e0;
  --alerta-borda: #e8b458;
  --raio: 12px;
  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--fonte); color: var(--texto); background: var(--creme); line-height: 1.65; font-size: 17px; }
img { max-width: 100%; height: auto; }
a { color: var(--verde); text-underline-offset: 2px; }
a:hover { color: var(--verde-escuro); }
h1, h2, h3 { line-height: 1.25; color: #1c2a21; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: .3em 0 .4em; }
h2 { font-size: 1.4rem; margin-top: 2em; }
h3 { font-size: 1.15rem; margin-top: 1.6em; }
.container { width: min(1100px, 100% - 2.5rem); margin-inline: auto; }
.estreito { width: min(760px, 100% - 2.5rem); }
.pular { position: absolute; left: -999px; }
.pular:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 10; }

/* Topo */
.topo { background: #fff; border-bottom: 1px solid var(--borda); position: sticky; top: 0; z-index: 5; }
.topo-inner { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 1rem; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--texto); font-size: 1.2rem; }
.logo strong { color: var(--verde); }
.menu { display: flex; gap: 1.4rem; }
.menu a { text-decoration: none; color: var(--texto); font-weight: 500; }
.menu a:hover { color: var(--verde); }
.menu-btn { display: none; background: none; border: 1px solid var(--borda); border-radius: 8px; padding: .4rem .8rem; font: inherit; cursor: pointer; }
@media (max-width: 700px) {
  .menu-btn { display: block; }
  .menu { display: none; width: 100%; flex-direction: column; gap: 0; padding-bottom: .6rem; }
  .menu.aberto { display: flex; }
  .menu a { padding: .6rem 0; border-top: 1px solid var(--borda); }
}

/* Hero */
.hero { background: linear-gradient(160deg, var(--verde-claro), var(--creme)); padding: 3.5rem 0 3rem; border-bottom: 1px solid var(--borda); }
.hero h1 { max-width: 20ch; }
.hero p { max-width: 55ch; font-size: 1.1rem; color: var(--suave); }
.hero-botoes { display: flex; gap: .8rem; flex-wrap: wrap; }
.botao { display: inline-block; background: var(--verde); color: #fff; padding: .75rem 1.3rem; border-radius: 999px; text-decoration: none; font-weight: 600; border: 2px solid var(--verde); cursor: pointer; font: inherit; font-weight: 600; }
.botao:hover { background: var(--verde-escuro); border-color: var(--verde-escuro); color: #fff; }
.botao.secundario { background: transparent; color: var(--verde); }
.botao.secundario:hover { background: var(--verde); color: #fff; }

/* Cards */
.secao { margin: 2.5rem 0; }
.lead { font-size: 1.1rem; color: var(--suave); max-width: 65ch; }
.cards { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card a { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1.2rem; background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); text-decoration: none; color: var(--texto); transition: border-color .15s, transform .15s; }
.card a:hover { border-color: var(--verde); transform: translateY(-2px); }
.card-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--verde); font-weight: 700; }
.card-titulo { font-weight: 700; font-size: 1.08rem; line-height: 1.3; }
.card-desc { color: var(--suave); font-size: .95rem; }
.destaques { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.destaques > div { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 0 1.4rem 1rem; }

/* Artigo */
.migalhas { font-size: .9rem; color: var(--suave); margin-top: 1.5rem; }
.migalhas a { color: var(--suave); }
.artigo { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.2rem clamp(1.1rem, 4vw, 2.5rem) 2rem; margin-top: 1rem; }
.categoria { text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; color: var(--verde); font-weight: 700; margin: .6rem 0 0; }
.info { color: var(--suave); font-size: .92rem; margin-top: 0; }
.artigo ul, .artigo ol { padding-left: 1.3rem; }
.artigo li { margin: .3rem 0; }
.aviso { background: var(--alerta); border-left: 4px solid var(--alerta-borda); padding: .8rem 1rem; border-radius: 8px; margin: 1.4rem 0; }
.dica { background: var(--verde-claro); border-left: 4px solid var(--verde); padding: .8rem 1rem; border-radius: 8px; margin: 1.4rem 0; }
.aviso p, .dica p { margin: .3rem 0; }
.tabela-wrap { overflow-x: auto; margin: 1.2rem 0; }
table.formula { width: 100%; border-collapse: collapse; font-size: .98rem; }
table.formula th, table.formula td { padding: .55rem .7rem; border-bottom: 1px solid var(--borda); text-align: left; }
table.formula td:nth-child(n+2), table.formula th:nth-child(n+2) { text-align: right; white-space: nowrap; }
table.formula thead th { background: var(--verde); color: #fff; }
table.formula tr.fase th { background: var(--verde-claro); color: var(--verde-escuro); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
table.formula tfoot td { font-weight: 700; }
.cta-calc { margin-top: 2rem; }
.relacionados { margin: 2.5rem 0; }

/* Anúncios */
.anuncio { margin: 1.8rem 0; min-height: 100px; text-align: center; }
.anuncio-rotulo { display: block; font-size: .7rem; color: #9a9a90; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3rem; }

/* Páginas */
.pagina { padding: 1.5rem 0 3rem; }

/* Calculadora */
.calc { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.2rem clamp(1rem, 3vw, 1.8rem); margin: 1.5rem 0; }
.calc-topo { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1rem; }
.calc label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.calc input, .calc select { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid #cfc9bd; border-radius: 8px; background: #fff; }
.calc input:focus, .calc select:focus { outline: 2px solid var(--verde); border-color: var(--verde); }
.calc-linhas { width: 100%; border-collapse: collapse; }
.calc-linhas th { text-align: left; font-size: .85rem; color: var(--suave); padding: .3rem .3rem; }
.calc-linhas td { padding: .3rem; vertical-align: middle; }
.calc-linhas td.g { text-align: right; font-weight: 700; white-space: nowrap; min-width: 85px; }
.calc-linhas .col-pct { width: 95px; }
.remover { background: none; border: none; color: #a04a3a; font-size: 1.3rem; cursor: pointer; padding: 0 .3rem; line-height: 1; }
.calc-acoes { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.calc-total { margin-top: 1rem; padding: .8rem 1rem; border-radius: 8px; font-weight: 600; }
.calc-total.ok { background: var(--verde-claro); color: var(--verde-escuro); }
.calc-total.erro { background: var(--alerta); color: #7a4b00; }
@media (max-width: 520px) { .calc-linhas .col-pct { width: 70px; } .calc-linhas td.g { min-width: 70px; } }

/* Rodapé */
.rodape { background: #1f3027; color: #d7e2da; margin-top: 3rem; padding: 2rem 0; font-size: .92rem; }
.rodape a { color: #fff; margin-right: 1.2rem; display: inline-block; margin-bottom: .4rem; }
.rodape-aviso { max-width: 70ch; color: #b9c8bd; }

@media print {
  .topo, .rodape, .relacionados, .anuncio, .cta-calc, .migalhas, .calc-acoes, .remover { display: none !important; }
  body { background: #fff; }
  .artigo, .calc { border: none; }
}

/* Portal */
.card-selo { align-self: flex-start; background: var(--verde); color: #fff; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .15rem .55rem; border-radius: 999px; }
.card.ferramenta a { border-color: #c9dccf; }
.categorias .card-titulo { font-size: 1.2rem; }
.ferramenta-pagina { margin-top: 1rem; }
.rodape nav { margin: .4rem 0; }
.card.ferramenta .card-cat { display: none; }

/* Formulários das calculadoras */
.campos { display: grid; gap: .9rem 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.campo label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.campo small { display: block; color: var(--suave); font-size: .8rem; margin-top: .25rem; }
.calc input[type="text"], .calc input[type="number"] { font-variant-numeric: tabular-nums; }
.resultado { margin-top: 1.2rem; background: var(--verde-claro); border-radius: 10px; padding: 1rem 1.2rem; }
.resultado dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: .45rem 1rem; align-items: baseline; }
.resultado dt { color: var(--verde-escuro); font-size: .95rem; }
.resultado dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.resultado .destaque dt, .resultado .destaque dd { font-size: 1.2rem; color: #14281c; }
.resultado .destaque dd { font-size: 1.35rem; }
.calc-msg { margin-top: 1rem; background: var(--alerta); border-left: 4px solid var(--alerta-borda); padding: .7rem 1rem; border-radius: 8px; }
.linhas .linha { display: grid; grid-template-columns: 1.2fr 1fr auto 1fr 90px auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.linha .vezes { color: var(--suave); }
.linha-res { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.linha [data-remover] { background: none; border: none; color: #a04a3a; font-size: 1.3rem; cursor: pointer; }
@media (max-width: 560px) {
  .linhas .linha { grid-template-columns: 1fr 1fr; }
  .linha .vezes { display: none; }
  .linha [data-campo="nome"] { grid-column: 1 / -1; }
}
.subcalc { border-top: 1px solid var(--borda); padding-top: 1rem; margin-top: 1rem; }
.subcalc:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.subcalc h3 { margin: 0 0 .6rem; font-size: 1.05rem; }
.frase { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.frase input { width: 120px !important; }
.frase output { font-weight: 700; font-size: 1.1rem; color: var(--verde-escuro); }
.tabela-res td small { display: block; color: var(--suave); font-size: .8rem; font-weight: 400; }
.tabela-res td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
details.detalhes { margin-top: 1rem; }
details.detalhes summary { cursor: pointer; font-weight: 600; color: var(--verde); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .92rem; }
.check input { width: 1.1rem; height: 1.1rem; }
.info-linha { margin: .8rem 0 0; font-size: .95rem; color: var(--verde-escuro); }
