:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --surface-2: #f6f6f6;
  --text: #29282c;
  --muted: #6e6d72;
  --border: #e6e6e6;
  --border-strong: #d9d9d9;
  --accent: #ff4f1f;
  --accent-soft: #fff1ec;
  --dark: #1e1c21;
  --dark-hover: #36333a;
  --bar: #e6e6e8;
  --danger: #c4320a;
  --radius: 12px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  --shadow-pill: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 6px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Tema sempre claro, mesmo com o sistema em modo escuro */
html { color-scheme: light; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.ic {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic-accent { color: var(--accent); }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.logo img { display: block; height: 40px; width: auto; }
.nav { display: flex; gap: 28px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
}
.nav a:hover { color: var(--text); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
  padding-bottom: 32px;
}
.content { min-width: 0; }

.hero { padding: 20px 0 24px; }
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 8px;
}
.hero p { color: var(--muted); margin: 0; font-size: 1.02rem; max-width: 560px; }

/* ---------- Card (header / body / footer separados por linhas) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
}
.card-body { padding: 24px; }
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
}

.section-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 500;
}
.section-title small { color: var(--muted); font-weight: 400; font-size: .85rem; margin-left: 6px; }

/* ---------- Abas sublinhadas ---------- */
.tabs {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  padding: 16px 4px 14px;
  margin-right: 24px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab.active .ic { color: var(--accent); }

/* ---------- Formulário ---------- */
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 20px;
}
.field { display: flex; flex-direction: column; gap: 8px; }

.pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-pill);
  padding: 0 18px;
  min-height: 48px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.pill .ic { color: var(--text); }
.pill:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pill:has(:disabled) { opacity: .5; box-shadow: none; }

.pill select, .pill input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .98rem;
  font-weight: 500;
}
.pill input::placeholder { color: var(--muted); font-weight: 400; }
.pill select {
  appearance: none;
  cursor: pointer;
  padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236e6d72' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}
.pill select:disabled, .pill input:disabled { cursor: not-allowed; }
.pill select option { color: #29282c; background: #fff; }

.field-label, .field label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
  color: var(--text);
  font-weight: 500;
  padding-left: 4px;
}
.step {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  transition: background .2s, color .2s, border-color .2s;
}
.field:has(.combo-clear:not([hidden])) .step,
.field-ano:has(.chip-ano.active) .step {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.field-full { grid-column: 1 / -1; }
.field-comb { margin-top: 20px; }
#field-comb .step { display: none; }
.hint { margin: 0; padding-left: 4px; font-size: .8rem; color: var(--muted); }

/* ---------- Combobox com busca ---------- */
.combo { position: relative; }
.combo-clear {
  border: 0;
  background: var(--surface-2);
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.combo-clear:hover { color: var(--text); background: var(--border); }
.combo-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  overscroll-behavior: contain;
}
.combo-list li {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .95rem;
}
.combo-list li.ativo, .combo-list li:hover { background: var(--surface-2); }
.combo-list li.sel { color: var(--accent); font-weight: 600; }
.combo-list li.vazio { color: var(--muted); font-size: .85rem; cursor: default; background: none; }
.combo-list mark { background: none; color: var(--accent); font-weight: 600; }

/* ---------- Chips (marcas populares e anos) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  padding: 6px 14px;
  min-height: 36px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .1s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip:active { transform: scale(.96); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips-ano { margin-top: 10px; }
.chip-ano { min-height: 42px; padding: 8px 16px; font-size: .92rem; }
.chips .placeholder {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  width: 100%;
  padding: 14px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .9rem;
}
.loader {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.footer-hint { margin: 0; color: var(--muted); font-size: .88rem; text-align: right; }

.pill-sm { min-height: 38px; padding: 0 12px; gap: 6px; }
.pill-sm .ic { width: 18px; height: 18px; color: var(--accent); }
.pill-sm select { height: 36px; font-size: .9rem; max-width: 190px; }

/* Estado de carregamento do resultado */
#resultado.carregando :is(.result-value, .result-sub, .pill-static strong, .result-details dd) {
  color: transparent !important;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}
#resultado.carregando .result-value { display: inline-block; min-width: 200px; }
#resultado.carregando .result-sub { max-width: 280px; min-height: 1.4em; }
#resultado.carregando .pill-static strong { display: inline-block; min-width: 80px; min-height: 1.2em; }
#resultado.carregando .result-details dd { min-height: 1.3em; }
#resultado.carregando .chart, #resultado.carregando .comparativo { opacity: .3; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Botões ---------- */
.btn-primary, .btn-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 0 24px;
  min-height: 48px;
  cursor: pointer;
  transition: background .15s, transform .1s, opacity .15s, border-color .15s;
}
.btn-primary {
  border: 0;
  background: var(--dark);
  color: var(--surface);
}
.btn-primary .btn-label { display: inline-flex; align-items: center; gap: 8px; }
.btn-primary:hover:not(:disabled) { background: var(--dark-hover); }
.btn-primary:active:not(:disabled), .btn-secondary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; }

.btn-secondary {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pill);
}
.btn-secondary:hover { border-color: var(--muted); }

.spinner {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border: 2px solid color-mix(in srgb, var(--surface) 35%, transparent);
  border-top-color: var(--surface);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-primary.loading .btn-label { visibility: hidden; }
.btn-primary.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.erro {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--danger);
  font-size: .92rem;
  font-weight: 500;
}

/* ---------- Resultado ---------- */
#resultado.show { animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.badge {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: .8rem;
  padding: 5px 12px;
  border-radius: 999px;
}

.result-label { margin: 0; color: var(--muted); font-size: .95rem; }
.result-value {
  margin: 2px 0 2px;
  font-size: clamp(2.2rem, 7vw, 3rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--accent);
}
.result-sub { margin: 0 0 20px; font-weight: 500; }

.pill-row {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border-radius: 999px;
}
.pill-row .pill { flex: 1; }
.pill-static { gap: 8px; font-size: .98rem; white-space: nowrap; overflow: hidden; }
.pill-static span { color: var(--muted); }
.pill-static strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.pill-sep { width: 40px; height: 1px; background: var(--border-strong); flex-shrink: 0; }

.result-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 20px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.result-details div { padding: 12px 16px; border-left: 1px solid var(--border); }
.result-details div:first-child { border-left: 0; }
.result-details dt { font-size: .8rem; color: var(--muted); }
.result-details dd { margin: 2px 0 0; font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }

.isencao-msg {
  margin: 16px 0 0;
  padding: 12px 16px;
  background: var(--accent-soft);
  color: var(--text);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  font-size: .92rem;
}

/* ---------- Gráfico de barras por estado ---------- */
.chart-title { margin-top: 28px; }
.chart-scroll { padding-bottom: 4px; }
.chart {
  display: grid;
  grid-template-columns: repeat(27, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  height: 226px;
  position: relative;
  padding-top: 36px; /* espaço para o balão de valor da barra mais alta */
  padding-bottom: 34px;
}
/* régua de marcações abaixo das barras */
.chart::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  height: 7px;
  background: repeating-linear-gradient(to right, var(--border-strong) 0 1px, transparent 1px 8px);
}
.bar {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.bar-fill {
  width: 100%;
  background: var(--bar);
  border-radius: 2px 2px 0 0;
  transition: height .5s cubic-bezier(.2, .8, .2, 1), background .15s;
}
.bar:hover .bar-fill { background: color-mix(in srgb, var(--accent) 35%, var(--bar)); }
.bar.atual .bar-fill { background: var(--accent); }
.bar.atual::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--accent));
  opacity: .6;
}
.bar-label {
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .68rem;
  color: var(--muted);
  font-weight: 500;
}
.bar.atual .bar-label {
  color: var(--accent);
  font-weight: 700;
}
.bar-tip {
  position: absolute;
  bottom: calc(var(--h) + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: var(--surface);
  font-size: .75rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 2;
}
/* nas pontas, o balão se alinha para dentro para não sair do card */
.bar.tip-left .bar-tip { left: 0; transform: none; }
.bar.tip-right .bar-tip { left: auto; right: 0; transform: none; }
.bar:hover .bar-tip, .bar.atual .bar-tip { opacity: 1; }
.chart:hover .bar.atual:not(:hover) .bar-tip { opacity: 0; }

/* ---------- Tabela ---------- */
.comparativo { margin-top: 8px; }
.comparativo summary, .faq summary {
  cursor: pointer;
  font-weight: 500;
  padding: 14px 0;
}
.table-wrap {
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
}
td:nth-child(n+2), th:nth-child(n+2) { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.atual td { background: var(--accent-soft); }
tr.atual td:first-child strong { color: var(--accent); }
.muted { color: var(--muted); font-size: .88rem; }

/* ---------- Conteúdo informativo ---------- */
.info p { color: var(--muted); margin: 0 0 12px; }
.faq { padding-top: 6px; padding-bottom: 6px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq details p { margin: 0 0 14px; }
.faq summary::marker { color: var(--accent); }
.info a { color: var(--accent); }
.info .table-wrap { max-height: none; margin: 4px 0 16px; }

/* ---------- IPVA por estado ---------- */
.estados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  grid-auto-rows: 1fr; /* todos do mesmo tamanho, mesmo quando um nome quebra linha */
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.estados-grid a {
  height: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: .9rem;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.estados-grid a:hover { border-color: var(--accent); color: var(--accent); }
.estados-grid a[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent); }
.estados-grid strong { min-width: 24px; color: var(--accent); font-weight: 600; }
.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font-weight: 500;
  font-size: .95rem;
}
.formula span:not(.op) {
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pill);
  padding: 8px 16px;
  border-radius: 999px;
}
.formula .op { color: var(--muted); }
.formula .hl { background: var(--accent); border-color: var(--accent) !important; color: #fff; }

/* ---------- Espaços de anúncio ---------- */
.ad-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px auto;
  overflow: hidden;
}
/* Rótulo exibido enquanto o anúncio não é preenchido */
.ad-slot::before {
  content: "Publicidade";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  pointer-events: none;
}
.ad-slot ins { width: 100%; position: relative; z-index: 1; }
.ad-slot:has(ins[data-ad-status="filled"])::before { display: none; }

.ad-top, .ad-bottom { min-height: 100px; max-width: 970px; }
.ad-inline { min-height: 250px; margin: 24px 0; }
.card-body .ad-inline { margin: 24px 0 8px; }
.ad-sidebar { min-height: 600px; width: 300px; margin: 0; }
.sticky { position: sticky; top: 84px; }
.sidebar { padding-top: 96px; }

/* ---------- Anúncios simulados ---------- */
.ad-slot:has(.ad-mock)::before { display: none; }
.ad-slot:has(.ad-mock) ins { display: none !important; }
.ad-mock {
  position: relative;
  width: 100%;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--ad-fundo);
  border: 1px solid color-mix(in srgb, var(--ad-cor) 15%, transparent);
  border-radius: var(--radius);
  color: #1f2937;
  cursor: pointer;
  overflow: hidden;
}
.ad-mock-tag {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 3px 8px;
  background: rgba(255, 255, 255, .85);
  border-bottom-left-radius: 6px;
  font-size: .62rem;
  color: #6b7280;
}
.ad-mock-tag svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.ad-mock-img {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ad-cor), color-mix(in srgb, var(--ad-cor) 60%, #fff));
  color: #fff;
}
.ad-mock-img svg { width: 55%; height: 55%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ad-mock-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ad-mock-marca { font-size: .75rem; font-weight: 600; color: var(--ad-cor); }
.ad-mock-titulo { font-size: 1.05rem; line-height: 1.3; }
.ad-mock-texto { font-size: .85rem; color: #4b5563; line-height: 1.4; }
.ad-mock-cta {
  flex-shrink: 0;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ad-cor);
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
}
.ad-mock:hover .ad-mock-cta { filter: brightness(1.1); }

/* bloco no meio do conteúdo */
.ad-mock--inline { padding: 24px; gap: 24px; }
.ad-mock--inline .ad-mock-img { width: 38%; max-width: 260px; height: 200px; border-radius: 10px; }
.ad-mock--inline .ad-mock-img svg { width: 40%; height: 40%; }
.ad-mock--inline .ad-mock-titulo { font-size: 1.3rem; margin: 4px 0; }
.ad-mock--inline .ad-mock-texto { font-size: .95rem; }
.ad-mock--inline .ad-mock-cta { align-self: flex-end; }

/* arranha-céu na barra lateral */
.ad-mock--v { flex-direction: column; align-items: stretch; text-align: center; padding: 20px; gap: 20px; }
.ad-mock--v .ad-mock-img { width: 100%; height: 300px; border-radius: 10px; }
.ad-mock--v .ad-mock-img svg { width: 45%; height: 45%; }
.ad-mock--v .ad-mock-titulo { font-size: 1.4rem; margin: 6px 0; }
.ad-mock--v .ad-mock-texto { font-size: .95rem; }
.ad-mock--v .ad-mock-cta { padding: 14px; font-size: 1rem; }

/* ---------- Rodapé ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
}
.site-footer p { margin: 4px 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .card-header, .card-body, .card-footer { padding-left: 16px; padding-right: 16px; }
  .formula { flex-wrap: nowrap; justify-content: space-between; gap: 6px; font-size: .8rem; }
  .formula span:not(.op) { padding: 6px 10px; text-align: center; line-height: 1.25; border-radius: 16px; }
  .formula .op { flex: none; }
  .tabs { padding: 0 16px; gap: 0; justify-content: space-between; }
  .tab { margin-right: 0; font-size: .9rem; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pill-row { flex-direction: column; align-items: stretch; gap: 8px; background: none; }
  .pill-row .pill { width: 100%; }
  .pill-sep { display: none; }
  .result-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-details div:nth-child(3) { border-left: 0; }
  .result-details div:nth-child(n+3) { border-top: 1px solid var(--border); }
  /* banner compacto (formato 320×50 / 320×100) para não empurrar demais o formulário */
  .ad-top, .ad-bottom { min-height: 60px; max-height: 110px; }
  .ad-top { margin: 12px auto 4px; }
  .muted { display: none; }
  .hero { padding: 16px 0 16px; }
  .hero p { font-size: .95rem; }
  .pill input, .pill select { font-size: 16px; } /* evita zoom automático no iOS */
  .combo-list { max-height: 45vh; }
  .card-header { flex-wrap: wrap; }
  .pill-sm select { max-width: 150px; }
  .estados-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-hint { font-size: .8rem; }
  /* gráfico cabe na tela: barras mais finas e siglas intercaladas em duas linhas */
  .chart { gap: 3px; padding-bottom: 46px; height: 238px; }
  .chart::after { bottom: 34px; }
  .bar-label { font-size: .62rem; bottom: -30px; }
  .bar:nth-child(even) .bar-label { bottom: -44px; }
  .bar-tip { font-size: .7rem; }
  /* anúncios simulados compactos no celular */
  .ad-mock { padding: 12px 14px; gap: 12px; }
  .ad-mock--h .ad-mock-img { width: 44px; height: 44px; }
  .ad-mock--h .ad-mock-texto { display: none; }
  .ad-mock--h { padding: 10px 12px; }
  .ad-mock--h .ad-mock-marca { font-size: .68rem; }
  .ad-mock--h .ad-mock-titulo { font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ad-mock--h .ad-mock-cta { padding: 8px 14px; font-size: .8rem; }
  .ad-mock--inline { flex-direction: column; align-items: stretch; padding: 16px; gap: 14px; }
  .ad-mock--inline .ad-mock-img { width: 100%; max-width: none; height: 150px; }
  .ad-mock--inline .ad-mock-titulo { font-size: 1.1rem; }
  .ad-mock--inline .ad-mock-cta { align-self: stretch; text-align: center; }
}
