:root {
  --paper: #faf7f0;
  --card: #fffdf8;
  --ink: #1d2a26;
  --muted: #5b6862;
  --line: #ddd6c6;
  --green: #0f4c3a;
  --red: #b3261e;
  --blue: #1f3f8f;
  --amber: #fbf0d3;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.65 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--green); font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.6rem; margin: 2.6rem 0 .8rem; scroll-margin-top: 80px; }
h3 { font-size: 1.2rem; margin: 1.6rem 0 .5rem; }
li { margin-bottom: .45rem; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 2.5rem; padding-bottom: 3rem; }
.page > p, .page > ul, .page > ol, .page > h2, .page > h3, .page > .lede, .page > h1 { max-width: 760px; }
.lede { font-size: 1.2rem; color: var(--muted); margin: 0 0 1.5rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; background: #fff; padding: 8px 12px; z-index: 10; }

.top { background: var(--card); border-bottom: 3px solid var(--green); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; justify-content: space-between; align-items: center; min-height: 58px; gap: 16px; }
.logo { font: 700 1.2rem var(--serif); color: var(--green); text-decoration: none; white-space: nowrap; }
.logo i { color: var(--red); }
.menu summary { list-style: none; cursor: pointer; font-weight: 600; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; left: 12px; right: 12px; top: 58px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: calc(100vh - 80px); overflow-y: auto; }
.group > summary { list-style: none; cursor: pointer; font-weight: 600; padding: 12px; border: 0; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; color: var(--ink); }
.group > summary::-webkit-details-marker { display: none; }
.group > summary::after { content: "▾"; margin-left: 8px; font-size: .8em; transition: transform .15s; }
.group[open] > summary::after { transform: rotate(180deg); }
.group > summary:hover, .group[open] > summary { background: var(--paper); }
.group.active > summary { color: var(--red); }
.mega { padding: 4px 12px 12px; display: grid; gap: 14px; }
.mega ul { list-style: none; margin: 4px 0 0; padding: 0; }
.mega li { margin: 0; }
.mega a { display: block; text-decoration: none; color: var(--ink); border-radius: 5px; padding: 5px 8px; line-height: 1.3; font-size: .9rem; }
.mega a:hover, .mega a:focus-visible { background: var(--paper); color: var(--green); }
.mega .mega-page { font: 700 1rem var(--serif); color: var(--green); }
.mega .mega-page[aria-current] { color: var(--red); }
h2[id], h3[id] { scroll-margin-top: 80px; }
@media (min-width: 980px) {
  .top-in { position: relative; }
  .menu > summary { display: none; }
  .menu nav { position: static; display: flex; gap: 4px; padding: 0; border: 0; box-shadow: none; background: none; max-height: none; overflow: visible; }
  .group > summary { padding: 8px 12px; }
  .mega { position: absolute; left: 0; right: 0; top: 100%; margin-top: 3px; background: var(--card); border: 1px solid var(--line); border-radius: 0 0 10px 10px; box-shadow: 0 12px 28px rgba(0,0,0,.14); padding: 20px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); max-height: calc(100vh - 90px); overflow-y: auto; }
}

.hero { background: var(--green); color: #fff; padding: clamp(3rem, 8vw, 5.5rem) 0; border-bottom: 6px solid var(--red); }
.hero h1 { color: #fff; max-width: 15ch; }
.hero .lede { color: #d9e6df; max-width: 640px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: #b9d2c6; margin: 0 0 1rem; }
.btn { display: inline-block; background: var(--paper); color: var(--green); padding: 12px 20px; border-radius: 6px; font-weight: 700; text-decoration: none; }
.page .btn { background: var(--green); color: #fff; }
.btn:hover { background: #fff; }
.page .btn:hover { background: var(--ink); }

.three { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 2.8rem 0; }
.three h2 { font-size: 1.25rem; margin: 0 0 .4rem; }
.three p { margin: 0; }
.section { margin-top: 3.2rem; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.steps li { counter-increment: s; margin: 0; border-bottom: 1px solid var(--line); }
.steps a { display: grid; grid-template-columns: 48px 1fr; padding: 13px 4px; text-decoration: none; color: var(--ink); }
.steps a::before { content: counter(s); grid-row: span 2; font: 700 1.5rem var(--serif); color: var(--red); }
.steps a:hover b { color: var(--blue); }
.steps span { color: var(--muted); font-size: .95rem; }
.facts { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 0; }
.facts dt { font: 700 1.7rem var(--serif); color: var(--green); }
.facts dd { margin: 0; color: var(--muted); font-size: .95rem; }

.sources { font-size: .84rem; color: var(--muted); margin: .9rem 0 1.4rem; max-width: 760px; }
.note { background: #edf3ef; border-left: 4px solid var(--green); padding: 14px 18px; margin: 1.4rem 0; border-radius: 0 6px 6px 0; max-width: 760px; }
.note.warn { background: var(--amber); border-color: var(--red); }
.note ul { margin: 0; padding-left: 1.1rem; }

.table { overflow-x: auto; margin: 1rem 0; max-width: 860px; }
table { border-collapse: collapse; width: 100%; background: var(--card); font-size: .95rem; }
th, td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { background: var(--green); color: #fff; font-weight: 600; }
tbody th { font-weight: 600; background: #f3efe4; }
table.num td:last-child, table.num th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.check { list-style: none; padding: 0; }
.check li { margin: 0; border-bottom: 1px solid var(--line); }
.check label { display: flex; gap: 12px; padding: 10px 2px; cursor: pointer; }
.check input { width: 20px; height: 20px; flex: none; margin-top: 4px; accent-color: var(--green); }
.check input:checked + * { color: var(--muted); }
.numbered li { margin-bottom: .7rem; }
.glossary { max-width: 760px; }
.glossary dt { font-weight: 700; margin-top: .7rem; }
.glossary dd { margin: 0; color: var(--muted); }

.cities { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.cities article { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--green); padding: 16px 18px; border-radius: 4px; }
.cities h3 { margin: 0; }
.cities p { margin: .5rem 0; font-size: .96rem; }
.cities .tag { color: var(--red); font-size: .84rem; margin-top: .1rem; }

.sim { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); background: var(--card); border: 1px solid var(--line); padding: 18px; border-radius: 6px; max-width: 860px; }
.sim label { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; }
.sim input { font: inherit; padding: 8px 10px; border: 1px solid #a9a290; border-radius: 4px; background: #fff; width: 100%; }
.sim-total { grid-column: 1 / -1; display: grid; border-top: 2px solid var(--green); padding-top: 12px; }
.sim-total span { font: 700 1.8rem var(--serif); color: var(--green); }
.sim-total small { color: var(--muted); }

.foot { background: var(--ink); color: #cfd7d2; padding: 2.2rem 0; font-size: .9rem; margin-top: 3rem; }
.foot p { max-width: 760px; margin-top: 0; }
.foot b { color: #fff; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot a { color: #fff; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .top, .foot, .sim { display: none; } }
.top-in { max-width: 1200px; }

.toc { display: flex; flex-wrap: wrap; gap: 6px 14px; background: #edf3ef; padding: 12px 16px; border-radius: 6px; margin: 0 0 1.5rem; max-width: 760px; font-size: .92rem; }
.toc b { width: 100%; color: var(--green); }

/* Formato em cartões, passos e tabelas limpas */
.page h2, h2.section { border-left: 6px solid var(--red); padding-left: 12px; }
.page > h2 { max-width: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 1rem 0 1.5rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.card h3 { margin: 0 0 .4rem; color: var(--blue); font-size: 1.05rem; }
.card p { margin: 0; font-size: .96rem; }
.table { max-width: none; }
.table table { border: 1px solid var(--line); border-radius: 8px; }
th, td { border: 0; border-bottom: 1px solid var(--line); }
.numbered { list-style: none; counter-reset: n; padding: 0; display: grid; gap: 10px; max-width: none !important; }
.numbered li { counter-increment: n; position: relative; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 12px 56px; }
.numbered li::before { content: counter(n); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; }
.note { max-width: none; }
