:root {
  --paper: #f2f3f5;
  --surface: #ffffff;
  --ink: #171a21;
  --muted: #606978;
  --navy: #14223a;
  --cobalt: #315efb;
  --amber: #e6a20d;
  --red: #bd3447;
  --violet: #6547d9;
  --line: #cbd0d8;
  --line-dark: #8791a0;
  --focus-inner: #ffffff;
  --focus-outer: #14223a;
  --font-sans: Inter, "Helvetica Neue", Arial, sans-serif;
  --font-display: Inter, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Roboto Mono", "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; border-radius: 0 !important; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
}
h1, h2, h3, .brand { font-family: var(--font-display); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus-inner); outline-offset: 2px; box-shadow: 0 0 0 5px var(--focus-outer); }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; background: var(--surface); padding: 12px; }
.skip-link:focus { top: 16px; }
.site-header {
  min-height: 82px;
  padding: 0 clamp(22px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-dark);
  background: var(--paper);
  gap: 24px;
}
.brand { display: inline-flex; align-items: stretch; text-decoration: none; font-weight: 900; letter-spacing: -.06em; }
.brand-name { font-size: 25px; padding-right: 12px; }
.brand-digits { background: var(--cobalt); color: white; padding: 3px 7px; font: 700 13px/1.4 var(--font-mono); letter-spacing: 0; }
.site-header nav { display: flex; gap: clamp(18px, 3vw, 42px); margin-left: auto; font-size: 13px; font-weight: 700; }
.site-header nav a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; border-bottom: 2px solid transparent; }
.site-header nav a:hover, .site-header nav a:focus-visible { border-color: var(--cobalt); }
.preferences { position: relative; }
.preferences summary { min-height: 44px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--line-dark); color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; list-style: none; }
.preferences summary::-webkit-details-marker { display: none; }
.preferences summary::after { content: "+"; margin-left: 9px; font: 700 14px var(--font-mono); }
.preferences[open] summary::after { content: "−"; }
.preferences-panel { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: min(330px, calc(100vw - 30px)); display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line-dark); background: var(--surface); color: var(--ink); box-shadow: 10px 10px 0 rgba(20, 34, 58, .16); }
.preferences-panel p { margin: 0; color: var(--muted); font-size: 10px; }
.preferences-panel label { display: grid; grid-template-columns: 1fr minmax(130px, 1.2fr); align-items: center; gap: 12px; color: var(--muted); font-size: 10px; font-weight: 800; }
.preferences-panel select { min-height: 40px; border: 1px solid var(--line-dark); padding: 0 9px; background: white; color: var(--ink); font: 750 11px var(--font-sans); }
.preferences-panel button { min-height: 42px; border: 1px solid var(--line-dark); background: #eef0f3; color: var(--ink); font-size: 11px; font-weight: 850; cursor: pointer; }
.hero {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .92fr);
  border-bottom: 1px solid var(--line-dark);
}
.hero-copy { position: relative; padding: clamp(60px, 8vw, 124px) clamp(30px, 7vw, 112px); border-right: 1px solid var(--line-dark); }
.eyebrow { margin: 0 0 22px; color: var(--cobalt); font: 800 11px/1.2 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { max-width: 700px; margin-bottom: 30px; font-size: clamp(51px, 6vw, 94px); line-height: .95; letter-spacing: -.07em; }
.hero-lead { font-size: clamp(20px, 2vw, 29px); color: var(--navy); font-weight: 650; }
.hero-index { position: absolute; left: clamp(30px, 7vw, 112px); bottom: 36px; color: var(--line-dark); font: 700 12px var(--font-mono); }
.analyzer-shell { align-self: center; margin: clamp(30px, 5vw, 80px); border: 1px solid var(--line-dark); background: var(--surface); }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line-dark); }
.mode-switch button {
  min-height: 48px;
  border: 0;
  border-right: 1px solid var(--line-dark);
  background: #e8ebf0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.mode-switch button:last-child { border-right: 0; }
.mode-switch button[aria-selected="true"] { background: var(--surface); color: var(--cobalt); box-shadow: inset 0 -4px var(--cobalt); }
.analyzer { padding: clamp(25px, 4vw, 48px); }
.field-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 12px; }
.field-heading label { font-weight: 850; font-size: 18px; }
.field-heading span { color: var(--muted); font: 600 11px var(--font-mono); }
.input-row { display: grid; grid-template-columns: 1fr auto; }
.input-row input {
  min-width: 0;
  height: 64px;
  border: 1px solid var(--navy);
  padding: 0 18px;
  color: var(--navy);
  background: white;
  font: 700 clamp(19px, 2vw, 26px) var(--font-mono);
  letter-spacing: .03em;
  outline: none;
}
.input-row input:focus { box-shadow: inset 0 -4px var(--cobalt); }
.input-row input:focus-visible,
.batch-analyzer textarea:focus-visible {
  outline: 3px solid var(--focus-inner);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--focus-outer), inset 0 -4px var(--cobalt);
}
.batch-analyzer textarea {
  display: block;
  width: 100%;
  min-height: 210px;
  resize: vertical;
  border: 1px solid var(--navy);
  padding: 16px 18px;
  color: var(--navy);
  background: white;
  font: 650 15px/1.75 var(--font-mono);
  outline: none;
}
.batch-analyzer textarea:focus { box-shadow: inset 0 -4px var(--cobalt); }
.batch-analyzer[data-dragging="true"] { box-shadow: inset 0 0 0 5px var(--cobalt); background: #eef2ff; }
.batch-import { min-height: 48px; display: flex; align-items: center; gap: 13px; padding: 8px 0 13px; }
.batch-import button { min-height: 40px; border: 1px solid var(--line-dark); padding: 0 14px; background: #eef0f3; color: var(--navy); font-size: 11px; font-weight: 850; cursor: pointer; }
.batch-import button:hover, .batch-import button:focus-visible { border-color: var(--cobalt); background: white; }
.batch-import span { color: var(--muted); font-size: 11px; }
.batch-import span[data-error="true"] { color: var(--red); }
.batch-column { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 13px; padding: 9px 12px; border: 1px solid var(--line-dark); background: #f3f4f6; color: var(--muted); font-size: 11px; font-weight: 800; }
.batch-column[hidden] { display: none; }
.batch-column select { min-width: min(220px, 55%); min-height: 38px; border: 1px solid var(--line-dark); padding: 0 9px; background: white; color: var(--ink); }
.batch-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 14px; }
.batch-actions .field-help { margin: 0; }
.batch-actions button, .export-row button {
  min-height: 48px;
  border: 1px solid var(--cobalt);
  padding: 0 22px;
  background: var(--cobalt);
  color: white;
  font-weight: 850;
  cursor: pointer;
}
.batch-actions button:hover, .batch-actions button:focus-visible,
.export-row button:hover, .export-row button:focus-visible { border-color: var(--navy); background: var(--navy); }
#batch-counter[data-exceeded="true"] { color: var(--red); }
.input-row button, .result button, .panel-main button, .login-form button {
  border: 1px solid var(--cobalt);
  background: var(--cobalt);
  color: white;
  padding: 0 22px;
  min-height: 48px;
  font-weight: 850;
  cursor: pointer;
}
.input-row button:hover, .input-row button:focus-visible, .result button:hover, .result button:focus-visible { background: var(--navy); border-color: var(--navy); }
.field-help { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.privacy-note { margin: 0; border-top: 1px solid var(--line); padding: 17px clamp(25px, 4vw, 48px); color: var(--muted); font-size: 12px; }
.privacy-note span { color: var(--cobalt); margin-right: 8px; font-size: 9px; }
.result { border-top: 1px solid var(--line-dark); padding: clamp(25px, 4vw, 42px); }
.result:focus { outline-offset: -4px; }
.result[data-state="valid"], .result[data-state="completed"] { border-left: 6px solid var(--cobalt); }
.result[data-state="corrected"], .result[data-state="multiple"] { border-left: 6px solid var(--amber); }
.result[data-state="not_found"], .result[data-state="invalid_input"], .result[data-state="invalid_sequence"] { border-left: 6px solid var(--red); }
.result-header span, .candidate > span { color: var(--muted); font: 750 10px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.result-header h2 { margin: 6px 0 8px; font-size: 26px; letter-spacing: -.04em; }
.result-header p { color: var(--muted); font-size: 13px; }
.cpf-value-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin-top: 22px; }
.cpf-value { font: 800 clamp(21px, 3vw, 34px) var(--font-mono); letter-spacing: .02em; }
.cpf-value-row small { grid-column: 1 / -1; color: var(--muted); }
.copy-button { min-height: 38px !important; padding: 0 14px !important; font-size: 12px; }
.candidate-list { display: grid; gap: 1px; background: var(--line); margin-top: 24px; border: 1px solid var(--line); }
.candidate { background: var(--surface); padding: 18px; }
.batch-result { max-height: min(780px, 70vh); overflow: auto; }
.batch-result[data-state="batch"] { border-left: 6px solid var(--cobalt); }
.batch-list { display: grid; gap: 1px; margin: 24px 0 0; padding: 1px; background: var(--line); list-style: none; }
.batch-item { padding: 17px; background: var(--surface); border-left: 4px solid var(--line-dark); }
.batch-item[data-duplicate="true"] { background: #f3f4f6; box-shadow: inset 0 -1px var(--amber); }
.batch-item[data-state="valid"], .batch-item[data-state="completed"] { border-left-color: var(--cobalt); }
.batch-item[data-state="corrected"], .batch-item[data-state="multiple"] { border-left-color: var(--amber); }
.batch-item[data-state="not_found"], .batch-item[data-state="invalid_input"], .batch-item[data-state="invalid_sequence"] { border-left-color: var(--red); }
.batch-item-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; }
.batch-item-heading > span { color: var(--muted); font: 700 9px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.batch-item-heading > strong { font: 750 16px var(--font-mono); }
.batch-item-heading > em { padding: 4px 7px; border: 1px solid var(--line); color: var(--muted); font: normal 800 9px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.batch-item > p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.batch-candidates { display: grid; gap: 7px; margin-top: 13px; }
.batch-candidates > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); }
.batch-candidates span { font: 750 15px var(--font-mono); }
.batch-candidates small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.batch-filters { display: flex; flex-wrap: wrap; gap: 1px; padding: 18px clamp(25px, 4vw, 48px) 0; border-top: 1px solid var(--line-dark); background: var(--line); }
.batch-filters button { min-height: 40px; flex: 1 1 125px; border: 0; padding: 0 12px; background: #eef0f3; color: var(--muted); font-size: 10px; font-weight: 850; cursor: pointer; }
.batch-filters button[aria-pressed="true"] { background: var(--navy); color: white; }
.batch-filters button span { margin-left: 6px; font: 800 10px var(--font-mono); }
.batch-filter-empty { margin: 24px 0 0; padding: 22px; border: 1px solid var(--line); color: var(--muted); text-align: center; }
.export-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 clamp(25px, 4vw, 48px) 24px; }
.export-row button { width: 100%; background: var(--navy); border-color: var(--navy); }
.export-row button.preferred-export { box-shadow: inset 0 -5px var(--cobalt); }
.batch-filters[hidden], .export-row[hidden] { display: none; }
.content-grid { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); border-bottom: 1px solid var(--line-dark); }
.content-grid > * { min-height: 330px; padding: clamp(28px, 4vw, 62px); border-right: 1px solid var(--line-dark); }
.content-grid > *:last-child { border-right: 0; }
.section-heading h2, .facts h2, .faq h2 { font-size: clamp(31px, 4vw, 54px); line-height: 1.02; letter-spacing: -.06em; }
.content-grid article { position: relative; padding-top: 110px; }
.content-grid article h3 { font-size: 20px; }
.content-grid article p { color: var(--muted); font-size: 14px; }
.article-number { position: absolute; top: 38px; color: var(--cobalt); font: 800 14px var(--font-mono); }
.proof { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(38px, 7vw, 105px); padding: clamp(54px, 8vw, 116px); border-bottom: 1px solid var(--line-dark); }
.proof h2, .region-reference h2 { max-width: 720px; font-size: clamp(34px, 4.3vw, 62px); line-height: 1; letter-spacing: -.06em; }
.proof > div > p:last-child, .region-copy > p { max-width: 680px; color: var(--muted); }
.proof-example { align-self: center; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 22px; border: 1px solid var(--line-dark); padding: clamp(24px, 4vw, 42px); background: var(--surface); }
.proof-example > strong { font: 800 clamp(19px, 2vw, 27px) var(--font-mono); }
.proof-example > span { color: var(--cobalt); font: 800 24px var(--font-mono); }
.proof-example ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; font: 700 14px var(--font-mono); }
.ad-slot { min-height: 280px; display: grid; place-content: center; gap: 10px; padding: 32px; border-bottom: 1px solid var(--line-dark); background: #e7eaf0; color: var(--muted); text-align: center; }
.ad-slot > span { color: var(--cobalt); font: 850 10px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.ad-slot > strong { color: var(--ink); font-size: clamp(20px, 3vw, 30px); }
.ad-slot > p { max-width: 520px; margin: 0; font-size: 13px; }
.region-reference { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(38px, 7vw, 105px); padding: clamp(54px, 8vw, 116px); border-bottom: 1px solid var(--line-dark); background: #e7eaf0; }
.region-copy a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.region-map { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid var(--line-dark); border-left: 1px solid var(--line-dark); background: var(--surface); }
.region-map div { display: grid; grid-template-columns: 46px 1fr; min-height: 64px; border-right: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.region-map dt { display: grid; place-items: center; margin: 0; border-right: 1px solid var(--line); color: var(--cobalt); font: 850 17px var(--font-mono); }
.region-map dd { align-self: center; margin: 0; padding: 10px 12px; color: var(--muted); font-size: 11px; font-weight: 700; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: clamp(54px, 8vw, 116px); background: var(--navy); color: white; }
.facts .eyebrow { color: #8ca8ff; }
.facts > p { max-width: 600px; align-self: end; color: #cad2df; font-size: clamp(17px, 2vw, 22px); }
.faq { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(35px, 8vw, 120px); padding: clamp(54px, 8vw, 116px); }
.faq-items { border-top: 1px solid var(--line-dark); }
.faq details { border-bottom: 1px solid var(--line-dark); padding: 22px 0; }
.faq summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 24px; cursor: pointer; font-weight: 800; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font: 500 20px var(--font-mono); }
.faq details[open] summary::after { content: "−"; }
.faq details p { max-width: 660px; margin: 18px 0 0; color: var(--muted); }
footer { min-height: 130px; padding: 30px clamp(22px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; gap: 28px; border-top: 1px solid var(--line-dark); font-size: 12px; }
.footer-brand { font-size: 22px; }
footer p { margin: 0; color: var(--muted); }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
footer nav a { min-height: 32px; display: inline-flex; align-items: center; color: var(--muted); text-underline-offset: 3px; }
.legal-page { background: var(--paper); }
.legal-page .site-header nav { display: flex; }
.legal-content { width: min(100% - 44px, 900px); margin: 0 auto; padding: clamp(58px, 9vw, 120px) 0; }
.legal-content h1 { max-width: 760px; margin-bottom: 24px; font-size: clamp(50px, 8vw, 92px); line-height: .94; letter-spacing: -.07em; }
.legal-lead { margin-bottom: 64px; color: var(--navy); font-size: clamp(20px, 3vw, 28px); font-weight: 700; }
.legal-content h2 { margin: 48px 0 12px; padding-top: 20px; border-top: 1px solid var(--line-dark); font-size: clamp(23px, 3vw, 32px); letter-spacing: -.04em; }
.legal-content > p:not(.eyebrow, .legal-lead) { max-width: 760px; color: var(--muted); font-size: 16px; }
.legal-content a { text-underline-offset: 3px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 44px; color: var(--muted); font: 700 12px var(--font-mono); }
.guide-content { width: min(100% - 44px, 1080px); }
.guide-content > section { max-width: 820px; }
.guide-content > section:not(.focused-tool) p { color: var(--muted); font-size: 17px; }
.guide-index { max-width: 820px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0 0 72px; border: 1px solid var(--line-dark); background: var(--line-dark); }
.guide-index > * { min-height: 52px; display: flex; align-items: center; padding: 12px 16px; background: var(--surface); }
.guide-index strong { grid-column: 1 / -1; background: var(--navy); color: white; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.guide-index a { color: var(--navy); font-weight: 800; }
.guide-steps { max-width: 820px; display: grid; gap: 1px; margin: 24px 0; padding: 1px; background: var(--line-dark); list-style: none; counter-reset: guide-step; }
.guide-steps li { position: relative; min-height: 92px; padding: 22px 24px 22px 78px; background: var(--surface); color: var(--muted); counter-increment: guide-step; }
.guide-steps li::before { content: "0" counter(guide-step); position: absolute; left: 22px; top: 23px; color: var(--cobalt); font: 850 14px var(--font-mono); }
.guide-checklist { max-width: 820px; display: grid; gap: 1px; margin: 24px 0; padding: 1px; background: var(--line-dark); list-style: none; }
.guide-checklist li { position: relative; min-height: 58px; padding: 17px 20px 17px 54px; background: var(--surface); color: var(--muted); }
.guide-checklist li::before { content: "✓"; position: absolute; left: 20px; top: 17px; color: var(--cobalt); font: 850 14px var(--font-mono); }
.related-guides { max-width: 820px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 64px; padding: 1px; background: var(--line-dark); }
.related-guides a { min-height: 126px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 22px; background: var(--surface); color: var(--navy); text-decoration: none; }
.related-guides a:hover, .related-guides a:focus-visible { background: var(--navy); color: white; }
.related-guides span { color: var(--muted); font: 750 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.related-guides a:hover span, .related-guides a:focus-visible span { color: #cad2df; }
.related-guides strong { font-size: clamp(18px, 2.5vw, 24px); line-height: 1.1; }
.calculation-card, .calculation-result { max-width: 820px; display: grid; grid-template-columns: minmax(140px, .45fr) minmax(0, 1fr); gap: 1px; margin: 24px 0; padding: 1px; background: var(--line-dark); }
.calculation-card > *, .calculation-result > * { min-height: 54px; display: flex; align-items: center; margin: 0; padding: 14px 18px; background: var(--surface); }
.calculation-card > span, .calculation-result > span { color: var(--muted); font: 750 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.calculation-card code { overflow-wrap: anywhere; color: var(--navy); font: 750 13px/1.65 var(--font-mono); }
.calculation-card strong, .calculation-result strong { color: var(--cobalt); font: 850 16px var(--font-mono); }
.answer-grid { max-width: 820px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 24px 0; padding: 1px; background: var(--line-dark); }
.answer-grid div { min-height: 144px; padding: 22px; background: var(--surface); }
.answer-grid dt { margin-bottom: 12px; color: var(--navy); font-weight: 850; }
.answer-grid dd { margin: 0; color: var(--muted); }
.guide-cta { display: grid; grid-template-columns: 1fr auto; gap: 0 50px; align-items: end; margin-top: 78px; padding: clamp(30px, 6vw, 62px); border: 1px solid var(--line-dark); background: var(--navy); color: white; }
.guide-cta .eyebrow { grid-column: 1 / -1; color: #a9baff; }
.guide-cta h2 { margin-bottom: 14px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.05em; }
.guide-cta p:not(.eyebrow) { max-width: 620px; margin: 0; color: #cad2df; }
.button-link { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 20px; padding: 0 22px; border: 1px solid var(--cobalt); background: var(--cobalt); color: white; font-weight: 850; text-decoration: none; white-space: nowrap; }
.button-link:hover, .button-link:focus-visible { border-color: white; background: white; color: var(--navy); }
.error-content { min-height: 100vh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }

/* Editorial */
html[data-theme="editorial"] { --cobalt: #244ddd; --paper: #f5f1e8; --line: #c9c1b4; --line-dark: #827b70; }
html[data-theme="editorial"] .site-header { background: var(--navy); color: white; }
html[data-theme="editorial"] .hero { grid-template-columns: 1.15fr .85fr; min-height: 700px; }
html[data-theme="editorial"] .hero-copy { padding-top: 90px; }
html[data-theme="editorial"] .hero h1 { font-size: clamp(65px, 7.5vw, 120px); }
html[data-theme="editorial"] .analyzer-shell { margin-left: 0; }
html[data-theme="editorial"] .content-grid { grid-template-columns: 1.5fr 1fr; }
html[data-theme="editorial"] .content-grid article { min-height: 240px; }
html[data-theme="editorial"] .content-grid article:nth-of-type(2) { border-right: 0; }
html[data-theme="editorial"] .content-grid article:nth-of-type(3) { grid-column: 2; }

/* Contraste */
html[data-theme="contraste"] { --paper: #0e1727; --surface: #f7f8fa; --ink: #121824; --line: #3c485b; --line-dark: #607086; --cobalt: #4d73ff; }
html[data-theme="contraste"] body { background: var(--paper); color: white; }
html[data-theme="contraste"] .site-header { background: var(--paper); }
html[data-theme="contraste"] .hero-copy { background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), rgba(255,255,255,.08) 25%); }
html[data-theme="contraste"] .hero-lead { color: #bac8da; }
html[data-theme="contraste"] .analyzer-shell { color: var(--ink); box-shadow: 18px 18px 0 var(--amber); }
html[data-theme="contraste"] .content-grid { background: var(--surface); color: var(--ink); }
html[data-theme="contraste"] .faq { background: var(--surface); color: var(--ink); }
html[data-theme="contraste"] footer { color: white; }

/* A ferramenta ocupa o palco quando a introdução principal está oculta. */
html[data-theme] .hero.hero--tool-only { display: block; min-height: 0; }
.hero.hero--tool-only .analyzer-shell {
  width: min(880px, calc(100% - 44px));
  margin: clamp(38px, 7vw, 92px) auto;
}

/* Personalizações preservadas pelo painel */
html[data-theme][data-accent="cobalto"] { --cobalt: #315efb; }
html[data-theme][data-accent="indigo"] { --cobalt: #5b4bd8; }
html[data-theme][data-accent="rubi"] { --cobalt: #be345b; }
html[data-font="neutra"] {
  --font-sans: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-display: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
html[data-font="tecnica"] { --font-display: var(--font-mono); }
html[data-font="tecnica"] .hero h1 { letter-spacing: -.09em; }
html[data-density="compacta"] .site-header { min-height: 66px; }
html[data-density="compacta"] .hero { min-height: 540px; }
html[data-density="compacta"] .hero-copy { padding-top: clamp(48px, 6vw, 82px); padding-bottom: clamp(48px, 6vw, 82px); }
html[data-density="compacta"] .analyzer-shell { margin-top: 32px; margin-bottom: 32px; }
html[data-density="compacta"] .content-grid > * { min-height: 270px; padding-top: 38px; padding-bottom: 38px; }
html[data-density="compacta"] .facts,
html[data-density="compacta"] .faq { padding-top: clamp(42px, 6vw, 78px); padding-bottom: clamp(42px, 6vw, 78px); }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 460px; border-right: 0; border-bottom: 1px solid var(--line-dark); }
  .content-grid { grid-template-columns: 1fr 1fr; }
  .content-grid > * { border-bottom: 1px solid var(--line-dark); }
  .content-grid > *:nth-child(2n) { border-right: 0; }
  html[data-theme="editorial"] .hero { grid-template-columns: 1fr; }
  .proof, .region-reference { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .site-header { min-height: 68px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 0; }
  .site-header nav { width: calc(100% + 44px); flex: 1 0 calc(100% + 44px); display: flex; gap: 0; margin: 0 -22px; padding: 0 10px; border-top: 1px solid var(--line); overflow-x: auto; overscroll-behavior-inline: contain; }
  .site-header nav a { flex: none; padding: 4px 12px; }
  .hero-copy { min-height: 380px; padding-top: 58px; }
  .hero h1, html[data-theme="editorial"] .hero h1 { font-size: clamp(48px, 15vw, 72px); }
  .analyzer-shell { margin: 22px; }
  .input-row { grid-template-columns: 1fr; }
  .input-row button { min-height: 56px; }
  .batch-actions { align-items: stretch; flex-direction: column; }
  .batch-actions button { width: 100%; }
  .batch-import { align-items: stretch; flex-direction: column; }
  .batch-import button { width: 100%; }
  .batch-column { align-items: stretch; flex-direction: column; }
  .batch-column select { width: 100%; }
  .preferences-panel { position: fixed; top: 74px; right: 15px; }
  .content-grid, html[data-theme="editorial"] .content-grid, .facts, .faq { grid-template-columns: 1fr; }
  .content-grid > *, html[data-theme="editorial"] .content-grid article:nth-of-type(3) { grid-column: auto; border-right: 0; min-height: auto; }
  .content-grid article { padding-top: 75px; }
  footer { align-items: flex-start; flex-direction: column; }
  .cpf-value-row { grid-template-columns: 1fr; }
  .cpf-value-row small { grid-column: auto; }
  .proof-example { grid-template-columns: 1fr; }
  .proof-example > span { transform: rotate(90deg); width: max-content; }
  .region-map { grid-template-columns: 1fr; }
  .batch-item-heading { grid-template-columns: 1fr; }
  .batch-item-heading > span { grid-column: auto; }
  .batch-item-heading > em { width: max-content; }
  .batch-candidates > div { grid-template-columns: 1fr; }
  .batch-candidates small { grid-column: auto; }
  .export-row { grid-template-columns: 1fr; }
  .guide-index { grid-template-columns: 1fr; }
  .guide-index strong { grid-column: auto; }
  .related-guides, .answer-grid, .calculation-card, .calculation-result { grid-template-columns: 1fr; }
  .calculation-card > *, .calculation-result > * { min-height: auto; }
  .calculation-card > span, .calculation-result > span { padding-bottom: 6px; }
  .calculation-card > span:not(:first-child), .calculation-result > span:not(:first-child) { margin-top: 1px; }
  .guide-cta { grid-template-columns: 1fr; }
  .guide-cta .button-link { margin-top: 28px; }
  .ad-slot { min-height: 250px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Navegação e páginas de ferramentas compartilham a identidade do site. */
.site-header nav a[aria-current="page"], .site-header nav a.is-active { border-color: var(--cobalt); }
.tool-navigation { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 26px; padding: 8px 22px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.tool-navigation a { min-height: 44px; display: flex; align-items: center; padding: 8px 0; border-bottom: 2px solid transparent; text-decoration: none; font-size: 12px; font-weight: 750; }
.tool-navigation a[aria-current="page"], .tool-navigation a:hover { border-color: var(--cobalt); color: var(--cobalt); }
.home-tool { padding: clamp(38px, 7vw, 92px) 22px; border-bottom: 1px solid var(--line-dark); }
.home-heading { max-width: 880px; margin: 0 auto 26px; }
.home-heading h1 { max-width: 780px; margin-bottom: 16px; font-size: clamp(34px, 4.5vw, 58px); line-height: 1.03; letter-spacing: -.055em; }
.home-heading .hero-lead { margin: 0; }
.home-tool .analyzer-shell { max-width: 880px; margin: 0 auto; }
.tool-directory { padding: clamp(32px, 5vw, 64px) clamp(22px, 5vw, 76px); }
.directory-heading h2, .guide-teaser h2 { margin-bottom: 26px; font-size: clamp(28px, 3vw, 42px); line-height: 1.1; letter-spacing: -.045em; }
.tool-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line-dark); background: var(--line-dark); }
.tool-card { padding: 26px 22px; background: var(--surface); color: var(--ink); text-decoration: none; }
.tool-card > span { color: var(--cobalt); font: 800 10px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.tool-card h3 { display: flex; justify-content: space-between; gap: 12px; margin: 28px 0 14px; font-size: 22px; letter-spacing: -.04em; line-height: 1.15; }
.tool-card h3 span { color: var(--cobalt); }
.tool-card p { margin: 0; color: var(--muted); font-size: 13px; }
.tool-card:hover, .tool-card:focus-visible { box-shadow: inset 0 -4px var(--cobalt); }
.guide-teaser { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 38px clamp(22px, 5vw, 76px); border-top: 1px solid var(--line-dark); }
.guide-teaser h2 { margin-bottom: 12px; }
.guide-teaser p:last-child { max-width: 640px; margin: 0; color: var(--muted); }
.home-help { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 30px; padding: 16px 22px; font-size: 13px; }
.home-help a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer { display: grid; grid-template-columns: 1.5fr 1fr 1fr; align-items: start; padding-top: 40px; padding-bottom: 24px; }
.site-footer > div p { max-width: 320px; margin-top: 12px; }
.site-footer nav { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.site-footer nav strong { margin-bottom: 12px; font-size: 12px; }
.site-footer nav a { min-height: 36px; }
.footer-copyright { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--line); }
.tool-page .legal-content { padding-top: 32px; }
.tool-page .breadcrumbs { margin-bottom: 24px; }
.tool-page .legal-content h1 { font-size: clamp(36px, 5vw, 64px); line-height: 1; margin-bottom: 18px; }
.tool-page .legal-lead { max-width: 820px; margin-bottom: 28px; font-size: clamp(17px, 2vw, 22px); }
.tool-page .focused-tool { max-width: 100%; }
.focused-tool .analyzer-shell { margin: 0 0 44px; }
.tool-noscript { margin: 0; padding: 22px; border-top: 1px solid var(--line); color: var(--red); }
.result[data-state="invalid_cpf"] { border-left: 6px solid var(--red); }
.guide-topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 28px; padding: 1px; background: var(--line-dark); }
.guide-topics a { padding: 20px; background: var(--surface); color: var(--ink); font-weight: 750; }
html[data-theme="contraste"] .legal-lead, html[data-theme="contraste"] .legal-content > p:not(.eyebrow, .legal-lead), html[data-theme="contraste"] .guide-content > section:not(.focused-tool) p, html[data-theme="contraste"] .home-heading > p:last-child, html[data-theme="contraste"] .guide-teaser p:last-child, html[data-theme="contraste"] footer p, html[data-theme="contraste"] footer nav a, html[data-theme="contraste"] .breadcrumbs { color: #c9d3e3; }
html[data-theme="contraste"] .region-reference { color: var(--ink); }
html[data-theme="contraste"] .proof > div > p:last-child { color: #c9d3e3; }
html[data-theme="contraste"] .proof-example { color: var(--ink); }
html[data-theme="contraste"] .preferences summary, html[data-theme="editorial"] .preferences summary { color: inherit; }
html[data-theme="contraste"] .home-heading .eyebrow, html[data-theme="contraste"] .legal-content > .eyebrow, html[data-theme="contraste"] .guide-teaser .eyebrow, html[data-theme="contraste"] .proof .eyebrow, html[data-theme="contraste"] .directory-heading .eyebrow { color: #a9baff; }
@media (max-width: 1000px) {
  .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .site-header .brand { order: 1; }
  .site-header .preferences { order: 2; margin-left: auto; }
  .site-header nav { order: 3; justify-content: space-around; }
  .site-header nav a { padding: 4px 8px; }
  .tool-navigation { gap: 0 18px; justify-content: flex-start; }
  .tool-navigation a { font-size: 11px; }
  .guide-teaser { flex-direction: column; align-items: flex-start; }
  .site-footer { grid-template-columns: 1fr 1fr; gap: 28px 18px; }
  .site-footer > div { grid-column: 1 / -1; }
  .guide-topics { grid-template-columns: 1fr; }
  .tool-page .legal-content { padding-top: 24px; }
  .focused-tool .field-heading { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 440px) {
  .tool-cards { grid-template-columns: 1fr; }
  .tool-card h3 { margin-top: 16px; }
}
.tool-page .result-header h2 { margin: 6px 0 8px; padding: 0; border: 0; font-size: 26px; }
