:root {
  --bg: #f5f6f3;
  --card: #ffffff;
  --ink: #15201c;
  --muted: #586862;
  --line: #e1e7e3;
  --acc: #0d6b5f;
  --acc-ink: #ffffff;
  --acc-soft: #e3f2ee;
  --neg: #b42318;
  --warn-bg: #fff6e0;
  --warn-ink: #6b4700;
  --r: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 6px 20px rgba(16, 24, 20, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1412; --card: #161e1b; --ink: #e6eeea; --muted: #98aaa3; --line: #25302c;
    --acc: #3cc9b1; --acc-ink: #04221d; --acc-soft: #10332d; --neg: #ff8a7a;
    --warn-bg: #2d2410; --warn-ink: #f3d79a; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--acc); text-underline-offset: 2px; }
img, svg { max-width: 100%; }

/* topo */
.topo { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topo .in { max-width: 1080px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 750; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.marca svg { width: 30px; height: 30px; flex: none; }
.topo nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.topo nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.topo nav a:hover, .topo nav a[aria-current="page"] { color: var(--ink); background: var(--acc-soft); }
@media (max-width: 700px) {
  .topo nav { margin-left: 0; overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 2px; }
  .topo nav a { white-space: nowrap; }
}

main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 40px; }
h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .4em; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 2em 0 .6em; letter-spacing: -.01em; }
h3 { font-size: 1.08rem; margin: 1.5em 0 .4em; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 70ch; margin: 0 0 1.4em; }
.selo { display: inline-block; background: var(--acc-soft); color: var(--acc); font-weight: 650; font-size: 13px; padding: 3px 10px; border-radius: 99px; margin-bottom: 12px; }

/* calculadora */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } }
.cartao { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.calc form { display: grid; gap: 14px; }
.campo { display: grid; gap: 5px; }
.campo label, .campo .rot { font-weight: 600; font-size: 15px; }
.campo small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .dupla { grid-template-columns: 1fr; } }
input[type="text"], input[type="number"], input[type="date"], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
input:focus, select:focus { outline: 2px solid var(--acc); outline-offset: 1px; border-color: transparent; }
.prefixo { position: relative; }
.prefixo span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.prefixo input { padding-left: 38px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--acc); flex: none; }
button, .botao {
  font: inherit; font-weight: 650; background: var(--acc); color: var(--acc-ink); border: 0; border-radius: 10px;
  padding: 12px 18px; min-height: 46px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center;
}
button:hover, .botao:hover { filter: brightness(1.07); }

#resultado { position: sticky; top: 76px; }
@media (max-width: 860px) { #resultado { position: static; scroll-margin-top: 80px; } }
.destaque { background: var(--acc); color: var(--acc-ink); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; display: grid; gap: 2px; }
.destaque span { font-size: 14px; opacity: .9; }
.destaque strong { font-size: clamp(1.7rem, 4vw, 2.2rem); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.destaque small { font-size: 13.5px; opacity: .92; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.demo { margin-bottom: 14px; }
table.demo caption { text-align: left; font-weight: 700; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 4px 0 6px; }
table.demo th, table.demo td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.demo th { text-align: left; font-weight: 500; padding-right: 12px; }
table.demo th small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; line-height: 1.35; }
table.demo td { text-align: right; white-space: nowrap; }
table.demo tr.neg td { color: var(--neg); }
table.demo tr.tot th, table.demo tr.tot td { font-weight: 750; border-bottom: 0; }
.nota { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }
.aviso { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 12px 14px; font-size: 15px; }

/* conteúdo */
.texto { max-width: 76ch; }
.texto p, .texto li { color: var(--ink); }
.tabela-ref { width: 100%; margin: 10px 0 18px; font-size: 15px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tabela-ref th, .tabela-ref td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.tabela-ref thead th { background: var(--acc-soft); font-size: 13.5px; }
.tabela-ref tr:last-child td { border-bottom: 0; }
.tabela-ref td.n, .tabela-ref th.n { text-align: right; }
.rolagem { overflow-x: auto; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 14px 0; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.faq details p { margin: 8px 0 14px; }

/* home */
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 18px 0 8px; }
.card-link { display: grid; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s; }
.card-link:hover { border-color: var(--acc); }
.card-link strong { font-size: 1.05rem; }
.card-link span { color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.card-link em { color: var(--acc); font-style: normal; font-weight: 650; font-size: 14px; }

.relacionadas { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.relacionadas a { display: inline-block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; background: var(--card); font-size: 15px; }

.anuncio { margin: 26px 0; min-height: 0; }
.afiliado { margin: 26px 0; background: var(--acc-soft); border-radius: var(--r); padding: 16px 18px; }
.afiliado p { margin: 0 0 8px; }

/* rodapé */
.rodape { border-top: 1px solid var(--line); background: var(--card); }
.rodape .in { max-width: 1080px; margin: 0 auto; padding: 24px 20px 34px; color: var(--muted); font-size: 14px; display: grid; gap: 10px; }
.rodape nav { display: flex; gap: 16px; flex-wrap: wrap; }
.rodape a { color: var(--muted); }

[hidden] { display: none !important; }
