/* Portal: layout simples de revista — foto de capa, coluna de leitura e lista cronológica.
   Mobile primeiro; os ajustes para telas largas ficam no fim do arquivo. */

:root {
  color-scheme: light;
  --paper: #ffffff;
  --surface: #f4f6f4;
  --ink: #111a15;
  --muted: #59645d;
  --line: #e2e7e3;
  --brand: #07573a;
  --brand-deep: #052217;
  --on-brand: #f2faf5;
  --bar: #0c1410;
  --bar-ink: #f1f5f2;
  --nav: #02261a;
  --btn-bg: #07573a;
  --btn-ink: #ffffff;
  --mark: #ffd45c;
  --mark-ink: #1a211d;
  --notice-bg: #fff1c7;
  --notice-ink: #4f3a00;
  --ad-bg: #f1efe8;
  --danger: #a3271b;
  --focus: #1a5fd0;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d110f;
  --surface: #161c18;
  --ink: #e9eeea;
  --muted: #a2ada5;
  --line: #26302a;
  --brand: #6fd3a1;
  --brand-deep: #072a1c;
  --on-brand: #eaf7ef;
  --bar: #000000;
  --nav: #03201a;
  --btn-bg: #15694a;
  --btn-ink: #ffffff;
  --notice-bg: #3a2e08;
  --notice-ink: #ffe7a3;
  --ad-bg: #1b201c;
  --danger: #ff9b8f;
  --focus: #8ab4ff;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--sans); font-weight: 800; line-height: 1.2; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 5.5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 4vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }

.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
main.wrap { padding-block: 1.5rem 3rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--btn-bg); color: var(--btn-ink); padding: 0.6rem 1rem; border-radius: 0 0 8px 8px;
}
.skip-link:focus { top: 0; }

/* ---- Cabeçalho: barra escura com a marca, faixa verde com os temas ------- */
.site-header { background: var(--bar); color: var(--bar-ink); position: sticky; top: 0; z-index: 5; }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: 800 1.3rem/1 var(--sans); color: var(--bar-ink); text-decoration: none; letter-spacing: -0.02em;
}
.brand-group { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.brand__logo { width: 2rem; height: 2rem; border-radius: 6px; }
.brand__slogan { display: none; font-size: 0.85rem; color: var(--bar-ink); opacity: 0.7; padding-left: 0.9rem; border-left: 1px solid rgb(255 255 255 / 0.25); white-space: nowrap; }
@media (min-width: 40rem) { .brand__slogan { display: inline; } }
.brand__mark {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 6px;
  background: var(--mark); color: var(--mark-ink); font-size: 0.8rem; letter-spacing: 0;
}
.site-header__links { display: flex; gap: 0.25rem; }
.site-header__links a {
  color: var(--bar-ink); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: 0.6rem; opacity: 0.85;
}
.header-link-btn {
  color: var(--bar-ink); background: none; border: 0; cursor: pointer; font: 600 0.92rem/1 var(--sans);
  display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: 0.6rem; opacity: 0.85;
}
.header-link-btn:hover { opacity: 1; text-decoration: underline; }
.site-header__links a:hover { opacity: 1; text-decoration: underline; }
.themes { background: var(--nav); overflow-x: auto; scrollbar-width: none; }
.themes::-webkit-scrollbar { display: none; }
.themes ul { display: flex; gap: 1.5rem; list-style: none; padding: 0; margin-block: 0; white-space: nowrap; }
.themes a {
  display: block; padding-block: 0.6rem; color: #ffffff; text-decoration: none;
  font-size: 0.9rem; font-weight: 600; border-bottom: 3px solid transparent; opacity: 0.9;
}
.themes a:hover, .themes a[aria-current="page"] { border-bottom-color: var(--mark); opacity: 1; }

.site-header__links { margin-left: auto; }
.brand { white-space: nowrap; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-left: 0.25rem;
  background: transparent; color: var(--bar-ink); border: 0; border-radius: 50%; cursor: pointer;
}
.theme-toggle:hover { background: rgb(255 255 255 / 0.14); }
.theme-toggle svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }
:root:not([data-theme="dark"]) .theme-toggle__sun { display: none; }
.site-header__links { align-items: center; }

/* ---- Menu (3 linhas), busca e ajustes do celular, como no 9to5mac ---- */
.menu-btn, .search-btn {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--bar-ink); cursor: pointer; text-decoration: none;
}
.menu-btn { display: none; }
.menu-btn:hover, .search-btn:hover { background: rgb(255 255 255 / 0.14); }
.menu-btn svg, .search-btn svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search-bar { background: var(--bar); border-top: 1px solid rgb(255 255 255 / 0.12); padding-block: 0.6rem; }
.search-bar:not([hidden]) { display: block; }
.search-bar__row { display: flex; gap: 0.5rem; }
.search-bar input, .search-page input {
  flex: 1; min-width: 0; min-height: 2.75rem; padding: 0.5rem 0.8rem; border-radius: 8px; border: 2px solid transparent;
  font: 1rem var(--sans); background: #ffffff; color: #111a15;
}
.search-page { display: flex; gap: 0.5rem; margin-top: 1rem; }
.search-page input { border-color: var(--muted); background: var(--paper); color: var(--ink); }
.search-results .story-row { grid-template-columns: 9rem 1fr; }
.search-results h3 { font-size: 1.15rem; }
.search-results__summary { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.95rem; }
.mobile-menu { background: var(--bar); border-top: 1px solid rgb(255 255 255 / 0.12); max-height: calc(100vh - 3.6rem); overflow-y: auto; }
.mobile-menu ul { list-style: none; margin-block: 0; padding: 0.4rem 0 0.8rem; }
.mobile-menu a, .mobile-menu button {
  display: flex; align-items: center; width: 100%; min-height: 2.9rem; padding: 0 0.25rem; border: 0; background: none;
  color: var(--bar-ink); font: 600 1rem/1.2 var(--sans); text-align: left; text-decoration: none; cursor: pointer;
}
.mobile-menu a:hover, .mobile-menu button:hover { text-decoration: underline; }
.mobile-menu__label { padding: 0.8rem 0.25rem 0.2rem; font: 800 0.72rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; color: var(--bar-ink); }
.featured-tag {
  display: inline-block; margin: 0 0 0.7rem; padding: 0.3rem 0.6rem; border-radius: 4px; background: var(--mark); color: var(--mark-ink);
  font: 800 0.7rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase;
}
.lead-story { background: var(--surface); border-top: 4px solid var(--mark); border-radius: var(--radius); padding: 1rem; }

@media (max-width: 39.99rem) {
  .site-header__bar { flex-wrap: nowrap; gap: 0.25rem; min-height: 3.5rem; }
  .brand { font-size: 1.2rem; }
  .brand-group { flex: 1; min-width: 0; justify-content: center; }
  /* Com JavaScript: menu de 3 linhas à esquerda, marca no meio, busca à direita (links e temas vão para o menu). */
  .js .menu-btn { display: inline-grid; order: 0; }
  .js .brand-group { order: 1; }
  .js .search-btn { order: 2; }
  .js .site-header__links, .js .theme-toggle, .js .themes { display: none; }
  /* Sem JavaScript: links ficam numa linha própria. */
  .site-header__bar { flex-wrap: wrap; }
  .js .site-header__bar { flex-wrap: nowrap; }
  .site-header__links { order: 3; flex: 0 0 100%; margin-left: 0; justify-content: space-between; }
  .site-header__links a, .header-link-btn { flex: 1; justify-content: center; font-size: 0.88rem; padding-inline: 0.3rem; }
  .search-results .story-row { grid-template-columns: 6.5rem 1fr; }
}
@media (min-width: 40rem) { .mobile-menu { display: none !important; } }

/* ---- Elementos editoriais ---------------------------------------------- */
.kicker {
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 0.4rem;
}
.kicker a { text-decoration: none; }
.kicker .tag { margin-left: 0.5rem; }
.lede { font-size: 1.15rem; line-height: 1.55; color: var(--muted); }
.meta { font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0 0; }
.tag {
  display: inline-block; font: 700 0.68rem/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--notice-bg); color: var(--notice-ink); padding: 0.3rem 0.45rem; border-radius: 4px; vertical-align: middle;
}
.notice {
  background: var(--notice-bg); color: var(--notice-ink); border-radius: var(--radius);
  padding: 0.7rem 1rem; font-size: 0.92rem; margin-bottom: 1.25rem;
}
.notice a { color: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.9rem; padding: 0.65rem 1.2rem; border-radius: 8px; border: 2px solid var(--btn-bg);
  background: var(--btn-bg); color: var(--btn-ink); font: 700 1rem/1.2 var(--sans);
  text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn--ghost { background: transparent; color: var(--brand); border-color: currentColor; }
.btn--light { background: var(--mark); border-color: var(--mark); color: var(--mark-ink); }

/* Título de seção com fio que corre até a borda. */
.rule-title {
  display: flex; align-items: center; gap: 0.9rem;
  font-size: 1.5rem; margin: 2.25rem 0 1.1rem;
}
.rule-title::after { content: ""; flex: 1; height: 2px; background: var(--brand); opacity: 0.6; }

/* ---- Foto de capa (ou fundo do tema quando não há foto) ------------------- */
.cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--surface); }
.cover--placeholder {
  position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 1rem;
  color: #ffffff; background: linear-gradient(135deg, #07573a, #052217);
}
.cover--placeholder::before {
  content: "R$"; position: absolute; right: -0.05em; top: -0.18em;
  font: 800 clamp(6rem, 22vw, 11rem)/1 var(--sans); letter-spacing: -0.06em; opacity: 0.12;
}
.cover--placeholder span {
  position: relative; font: 800 0.75rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase;
  background: rgb(0 0 0 / 0.35); padding: 0.4rem 0.55rem; border-radius: 4px;
}
.cover--cartoes-e-beneficios { background: linear-gradient(135deg, #1d5fa8, #0d2a4d); }
.cover--credito-e-dividas { background: linear-gradient(135deg, #b0412e, #4a160d); }
.cover--compras-e-promocoes { background: linear-gradient(135deg, #c98a0a, #5a3a00); }
.cover--economia-no-bolso { background: linear-gradient(135deg, #07573a, #052217); }
.cover--thumb { border-radius: 4px; padding: 0; }
.cover--thumb::before { font-size: 3.2rem; }
.cover--thumb span { display: none; }

/* ---- Grade: coluna principal + lateral -------------------------------------- */
.layout { display: grid; gap: 2rem; }
.layout__main { min-width: 0; }

/* ---- Home --------------------------------------------------------------- */
.top { display: grid; gap: 1.5rem; }
.lead-story__cover { display: block; margin-bottom: 1rem; }
.lead-story h2 { font-size: clamp(1.7rem, 5.5vw, 2.4rem); }
.lead-story h2 a { color: var(--ink); text-decoration: none; }
.lead-story h2 a:hover { color: var(--brand); }
.highlights .rule-title { margin-top: 0; }

.story-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.story-row { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.9rem; align-items: start; }
.story-row h3 { font-size: 1rem; line-height: 1.3; }
.story-row h3 a { color: var(--ink); text-decoration: none; }
.story-row h3 a:hover { color: var(--brand); }
.story-row .meta { margin-top: 0.3rem; font-size: 0.8rem; }

.article-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2rem; }
.article-item { border-bottom: 1px solid var(--line); padding-bottom: 2rem; }
.article-item h3 { font-size: clamp(1.35rem, 4vw, 1.75rem); }
.article-item h3 a { color: var(--ink); text-decoration: none; }
.article-item h3 a:hover { color: var(--brand); }
.article-item__cover { display: block; margin: 0.9rem 0; }
.article-item__summary { color: var(--muted); }
.article-item__summary p { margin: 0 0 0.8rem; }
.article-item__summary p:last-child { margin-bottom: 0; }
.article-item__summary a { font-weight: 700; white-space: nowrap; }
/* "+ Expandir": com JavaScript o texto abre na própria lista; sem ele, vale o link "Ler mais". */
.expand__body { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.expand__btn { display: none; }
.js .expand__btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem; width: 100%;
  margin-top: 1rem; padding: 0.4rem; background: none; border: 0; color: var(--ink);
  font: 800 0.78rem/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}
/* Ícone "+" desenhado com duas barras: ao abrir, ele gira e a barra vertical se funde com a horizontal ("−"). */
.expand__icon { position: relative; display: inline-block; width: 2.2rem; height: 2.2rem; transition: transform 0.45s ease-in-out; }
.expand__icon::before, .expand__icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 100%; height: 3px; border-radius: 2px; background: var(--brand);
  transition: transform 0.45s ease-in-out;
}
.expand__icon::before { transform: translate(-50%, -50%); }
.expand__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.expand__icon.is-minus { transform: rotate(180deg); }
.expand__icon.is-minus::after { transform: translate(-50%, -50%) rotate(0deg); }
@media (prefers-reduced-motion: reduce) { .expand__icon, .expand__icon::before, .expand__icon::after { transition: none; } }
.expand__btn:hover .expand__icon:not(.is-minus) { transform: scale(1.12); }
.js .expand__body { display: none; }
.js .article-item.is-open .expand__body, .js .article-item.is-animating .expand__body { display: block; }
.js .expand__fallback { display: none; }
.js .article-item.is-open .article-item__summary { display: none; }
.js .article-item.is-animating .article-item__summary { display: block; } /* o texto completo já começa igual */
.expand__open-page { display: block; margin-top: 0.75rem; font-weight: 700; text-align: center; }
.banner-slot .ad { margin: 2rem 0 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  border-top: 2px solid var(--brand); padding-top: 0.7rem; margin: 2.25rem 0 1rem;
}
.section-head a { font-size: 0.95rem; font-weight: 600; white-space: nowrap; }

.page-head .rule-title { font-size: clamp(1.7rem, 5vw, 2.2rem); margin-top: 0.5rem; }
.page-head .lede { margin-top: -0.4rem; }

.empty { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 1.5rem; color: var(--muted); }

/* ---- Lateral ------------------------------------------------------------------ */
.sidebar .rule-title { font-size: 1.25rem; margin-top: 0; }
.sidebar > section + section { margin-top: 2.25rem; }
.tool-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.tool-link {
  display: grid; gap: 0.25rem; padding: 1rem; border-radius: var(--radius); text-decoration: none;
  background: var(--brand-deep); color: var(--on-brand);
}
.tool-link:hover { filter: brightness(1.15); }
.tool-link__name { font-weight: 800; font-size: 1.05rem; }
.tool-link__desc { font-size: 0.88rem; opacity: 0.85; line-height: 1.45; }
.tool-link__cta { font-weight: 700; color: var(--mark); font-size: 0.9rem; margin-top: 0.2rem; }
.mini-signup { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.mini-signup h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.mini-signup p { font-size: 0.92rem; color: var(--muted); }

/* ---- Matéria ------------------------------------------------------------- */
.article__head h1 { margin-top: 0.2rem; }
.article__head .meta { margin-top: 0.7rem; }
.article__cover { margin: 1.25rem 0; }
.article .lede { font-weight: 500; margin-bottom: 1.25rem; }
.prose { font-size: 1.1rem; line-height: 1.7; }
.prose h2 { margin: 2rem 0 0.6rem; font-size: 1.45rem; }
.prose h3 { margin: 1.5rem 0 0.5rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose blockquote { margin: 1.25rem 0; padding: 0.2rem 0 0.2rem 1rem; border-left: 4px solid var(--brand); color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; font-size: 1rem; margin-bottom: 1rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 0.5rem; text-align: left; }

.callout {
  border-left: 5px solid var(--brand); border-radius: var(--radius); padding: 1.2rem; margin-block: 1.75rem;
  background: var(--surface);
}
.callout__label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 0.3rem; }
.callout h2 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.callout p { color: var(--muted); }

.sources { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; font-size: 0.95rem; }
.sources h2 { font: 800 0.8rem/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5rem; }
.sources ul { padding-left: 1.2rem; margin: 0 0 0.5rem; }

/* ---- Página de ferramentas -------------------------------------------------- */
.tools-grid { display: grid; gap: 1rem; }
.tool-card {
  display: flex; flex-direction: column; gap: 0.7rem; align-items: flex-start;
  background: var(--brand-deep); color: var(--on-brand); border-radius: var(--radius); padding: 1.4rem;
}
.tool-card h2, .tool-card h3 { font-size: 1.45rem; }
.tool-card p { margin: 0; opacity: 0.9; }
.tool-card .btn { margin-top: 0.4rem; }
.tool-card__label { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mark); }

/* ---- Formulários ----------------------------------------------------------- */
.calc { display: grid; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-block: 1.25rem; }
.calc .btn { justify-self: start; }
.field label, .field legend { display: block; font-weight: 700; margin-bottom: 0.35rem; padding: 0; }
.field input[type="text"], .field input[type="number"], .field input[type="email"] {
  width: 100%; min-height: 3rem; padding: 0.6rem 0.8rem; font: 600 1.15rem/1.2 var(--sans); font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--paper); border: 2px solid var(--muted); border-radius: 10px;
}
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field__money { display: flex; align-items: stretch; }
.field__money span {
  display: flex; align-items: center; padding-inline: 0.8rem; font-weight: 700; color: var(--muted);
  border: 2px solid var(--muted); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface);
}
.field__money input[type="text"] { border-radius: 0 10px 10px 0; }
.field__help { font-size: 0.9rem; color: var(--muted); margin: 0.35rem 0 0; }
.field__error { font-size: 0.95rem; font-weight: 600; color: var(--danger); margin: 0.35rem 0 0; }
.form-error { color: var(--danger); font-weight: 600; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.2rem; }
.checks label { display: flex; align-items: center; gap: 0.6rem; font-weight: 500; min-height: 2.75rem; margin: 0; }
.checks input { width: 1.25rem; height: 1.25rem; accent-color: var(--btn-bg); flex: none; }
.hp { position: absolute; left: -200vw; }

/* ---- Resultado em formato de comprovante ------------------------------------ */
.receipt {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.2rem; margin-block: 1.5rem; scroll-margin-top: 1rem;
  border-top: 6px solid var(--brand);
}
.receipt h2 { font: 700 0.85rem/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.receipt__sentence { font: 600 1.35rem/1.35 var(--serif); margin: 0.6rem 0 1rem; }
.receipt__rows { margin: 0; font-family: var(--mono); font-size: 0.98rem; }
.receipt__rows > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
  padding-block: 0.55rem; border-bottom: 1px dashed var(--line);
}
.receipt__rows dt { color: var(--muted); }
.receipt__rows dd { margin: 0; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt__rows .receipt__total { border-bottom: 0; font-size: 1.1rem; }
.receipt__rows .receipt__total dt { color: var(--ink); font-weight: 700; }
mark { background: var(--mark); color: var(--mark-ink); padding: 0.1em 0.35em; border-radius: 4px; }
.receipt__note { font-size: 0.92rem; color: var(--muted); margin: 1rem 0 0; }

.share { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.share label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.35rem; }
.share__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share__row input {
  flex: 1 1 14rem; min-width: 0; min-height: 3rem; padding: 0.5rem 0.7rem; font: 0.9rem var(--mono);
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
}
.share__status { font-size: 0.9rem; color: var(--brand); min-height: 1.4em; margin: 0.4rem 0 0; font-weight: 600; }

/* ---- Ranking de cartões -------------------------------------------------------- */
.ranking { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: 1rem; counter-reset: rank; }
.rank { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.rank--first { border: 2px solid var(--brand); }
.rank__head { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; align-items: start; }
.rank__pos {
  align-self: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-deep); color: var(--on-brand); font: 700 1.1rem var(--serif);
}
.rank__issuer { margin: 0; color: var(--muted); font-size: 0.95rem; }
.rank__balance { margin: 0.9rem 0 0; grid-column: 1 / -1; }
.rank__balance span { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rank__balance strong { font: 700 1.9rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.rank__balance--negative strong { color: var(--danger); }
.rank__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0.9rem 0; }
.rank__facts dt { font-size: 0.85rem; color: var(--muted); }
.rank__facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank details { border-top: 1px dashed var(--line); padding-top: 0.6rem; }
.rank summary { cursor: pointer; font-weight: 700; color: var(--brand); min-height: 2.5rem; display: flex; align-items: center; }
.rank details ol { margin: 0.4rem 0 0.6rem; padding-left: 1.3rem; font-size: 0.95rem; }
.rank__extra, .rank__source { font-size: 0.92rem; color: var(--muted); margin: 0.6rem 0 0; }
.rank__sponsored { margin-top: 0.9rem; padding: 0.8rem; border-radius: 10px; background: var(--ad-bg); }
.rank__sponsored .btn { margin-top: 0.5rem; }

.assumptions { font-size: 0.95rem; color: var(--muted); }
.assumptions ul { padding-left: 1.2rem; margin: 0.4rem 0 1rem; }

.terms-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.terms-table th, .terms-table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.terms-table thead th { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.table-scroll { overflow-x: auto; }

/* ---- Espaços comerciais, sempre identificados ----------------------------------- */
.ad { background: var(--ad-bg); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-block: 2rem; }
.ad__label {
  font: 700 0.72rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 0.6rem;
}
.ad__headline { font: 800 1.2rem/1.25 var(--sans); margin: 0 0 0.3rem; }
.ad p { margin-bottom: 0.7rem; }

/* ---- Newsletter -------------------------------------------------------------------- */
.signup { background: var(--brand-deep); color: var(--on-brand); border-radius: var(--radius); padding: 1.4rem 1.2rem; margin-block: 2rem; }
.signup h2 { font-size: 1.5rem; }
.signup > p { opacity: 0.92; margin: 0.4rem 0 1rem; }
.signup form { display: grid; gap: 1rem; }
.signup .field input[type="email"] { background: #ffffff; color: #1a211d; border-color: transparent; }
.signup .field__error, .signup .form-error { color: #ffd0c9; }
.signup .checks input { accent-color: var(--mark); }
.signup .btn { justify-self: start; }
.signup__fine { font-size: 0.85rem; opacity: 0.85; margin: 0; }
.signup a { color: inherit; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.2rem; max-width: 40rem; }
.panel form { display: grid; gap: 1rem; margin-top: 1rem; }
.panel .btn { justify-self: start; }

.pagination { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }

/* ---- Ranking: ilustração do cartão e dicas (i) ---- */
.rank__name { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.card-thumb {
  position: relative; flex: none; width: 3.9rem; height: 2.45rem; border-radius: 0.4rem; padding: 0.3rem 0.4rem;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: var(--ink);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.3), inset 0 0 0 1px rgb(255 255 255 / 0.18);
  display: flex; flex-direction: column; justify-content: space-between;
}
.card-thumb__chip { width: 0.85rem; height: 0.62rem; border-radius: 0.12rem; background: linear-gradient(135deg, #f6e08c, #b8923a); }
.card-thumb b { align-self: flex-end; font: 800 0.62rem/1 var(--sans); letter-spacing: 0.02em; }
.info {
  position: relative; display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; margin-left: 0.3rem; padding: 0;
  vertical-align: middle; border: 1.5px solid currentColor; border-radius: 50%; background: none; color: var(--muted); cursor: help;
  font: italic 700 0.72rem/1 Georgia, serif; text-transform: none; letter-spacing: 0;
}
.info:hover, .info:focus-visible { color: var(--brand); }
.info__tip {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 8; width: min(17rem, 78vw); padding: 0.6rem 0.75rem;
  background: var(--ink); color: var(--paper); border-radius: 8px; box-shadow: 0 6px 18px rgb(0 0 0 / 0.35);
  font: 500 0.82rem/1.4 var(--sans); font-style: normal; text-align: left; text-transform: none; letter-spacing: 0;
  opacity: 0; visibility: hidden; transition: opacity 0.15s; pointer-events: none;
}
.info:hover .info__tip, .info:focus .info__tip { opacity: 1; visibility: visible; }
.rank__facts > div:nth-child(2) .info__tip, .rank__balance .info__tip { left: auto; right: 0; }

/* ---- Espaços de anúncio (AdSense): altura reservada para a página não "pular" ---- */
.ad-slot { display: block; margin-block: 1.5rem; text-align: center; }
.ad-slot__label { display: block; font: 700 0.65rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.ad-slot__box { display: grid; place-items: center; width: 100%; background: var(--surface); border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-size: 0.8rem; }
.ad-slot--topo .ad-slot__box, .ad-slot--topo ins { min-height: 100px; }
.ad-slot--lateral .ad-slot__box, .ad-slot--lateral ins { min-height: 250px; }
.ad-slot--feed .ad-slot__box, .ad-slot--feed ins, .ad-slot--artigo .ad-slot__box, .ad-slot--artigo ins { min-height: 280px; }
@media (min-width: 46rem) { .ad-slot--topo .ad-slot__box, .ad-slot--topo ins { min-height: 90px; } }
.article-list__slot { list-style: none; }
.article-list__slot .ad-slot { margin: 0; }

/* ---- Popup de inscrição na newsletter ---- */
.nl-dialog { border: 0; border-radius: 14px; padding: 0; width: min(92vw, 28rem); background: var(--paper); color: var(--ink); box-shadow: 0 24px 60px rgb(0 0 0 / 0.45); }
.nl-dialog::backdrop { background: rgb(0 0 0 / 0.6); }
.nl-dialog__form { position: relative; display: grid; gap: 0.9rem; padding: 1.6rem 1.4rem 1.3rem; }
.nl-dialog h2 { font-size: 1.45rem; padding-right: 2rem; }
.nl-dialog__lead { color: var(--muted); margin: 0; }
.nl-dialog__close { position: absolute; top: 0.5rem; right: 0.6rem; width: 2.75rem; height: 2.75rem; border: 0; background: none; color: var(--muted); font-size: 2rem; line-height: 1; cursor: pointer; }
.nl-dialog__status { min-height: 1.4em; margin: 0; font-weight: 600; }
.nl-dialog__status.is-error { color: var(--danger); }
.nl-dialog__status.is-ok { color: var(--brand); }
.nl-dialog__fine { font-size: 0.85rem; color: var(--muted); margin: 0; }
.nl-dialog .btn { justify-self: start; }
.nl-dialog.is-done .field, .nl-dialog.is-done .btn, .nl-dialog.is-done .nl-dialog__fine { display: none; }

/* ---- Feedback: botão fixo + popup ---- */
.fb-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 6; min-height: 2.75rem; padding: 0.55rem 1rem;
  background: var(--btn-bg); color: var(--btn-ink); border: 0; border-radius: 999px; cursor: pointer;
  font: 700 0.9rem/1 var(--sans); box-shadow: 0 6px 18px rgb(0 0 0 / 0.35);
}
.fb-fab:hover { filter: brightness(1.12); }
body:has(dialog[open]) .fb-fab { display: none; }
.fb-rating { display: flex; gap: 0.5rem; border: 0; padding: 0; margin: 0; }
.fb-rating label { flex: 1; cursor: pointer; }
.fb-rating input { position: absolute; opacity: 0; pointer-events: none; }
.fb-rating span { display: grid; justify-items: center; gap: 0.2rem; padding: 0.6rem 0.3rem; border: 2px solid var(--line); border-radius: 10px; font-size: 0.85rem; font-weight: 600; text-align: center; }
.fb-rating b { font-size: 1.6rem; font-weight: 400; line-height: 1; }
.fb-rating input:checked + span { border-color: var(--brand); background: var(--surface); }
.fb-rating input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.fb-dialog textarea, .fb-dialog input[type="email"] {
  width: 100%; padding: 0.6rem 0.8rem; font: 1rem/1.4 var(--sans); color: var(--ink); background: var(--paper);
  border: 2px solid var(--muted); border-radius: 10px;
}
.fb-dialog label { font-weight: 700; font-size: 0.92rem; }
.fb-dialog .field label { display: block; margin-bottom: 0.3rem; }
/* Versão compacta do popup de feedback (altura ~30% menor) */
.fb-dialog .nl-dialog__form { gap: 0.4rem; padding: 0.9rem 1.1rem 0.7rem; }
.fb-dialog textarea { height: 3.3rem; resize: none; }
.fb-dialog h2 { font-size: 1.15rem; }
.fb-dialog .nl-dialog__lead { font-size: 0.88rem; line-height: 1.35; }
.fb-rating span { padding: 0.3rem 0.3rem; font-size: 0.8rem; gap: 0.05rem; }
.fb-rating b { font-size: 1.25rem; }
.fb-dialog textarea, .fb-dialog input[type="email"] { padding: 0.4rem 0.65rem; font-size: 0.95rem; }
.fb-dialog label { font-size: 0.85rem; }
.fb-dialog .field label { margin-bottom: 0.15rem; }
.fb-dialog .btn { min-height: 2.4rem; padding: 0.4rem 1.1rem; }
.fb-dialog .nl-dialog__status { min-height: 1.1em; font-size: 0.88rem; }
.fb-dialog .nl-dialog__fine { font-size: 0.75rem; }
.fb-dialog.is-done .field, .fb-dialog.is-done .fb-rating, .fb-dialog.is-done .btn, .fb-dialog.is-done .nl-dialog__fine { display: none; }

/* ---- Rodapé -------------------------------------------------------------------------- */
.site-footer { background: var(--bar); color: #b9c4bd; padding-block: 2rem; font-size: 0.92rem; }
.site-footer__brand { font: 800 1.15rem var(--sans); color: var(--bar-ink); margin-bottom: 0.3rem; }
.site-footer__links { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; color: var(--bar-ink); }

/* ---- Telas largas ----------------------------------------------------------------------- */
@media (min-width: 46rem) {
  main.wrap { padding-block: 2rem 4rem; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .calc--row { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .calc--row .btn { grid-column: 1 / -1; }
  .receipt { padding: 1.75rem; }
  .rank__head { grid-template-columns: auto 1fr auto; }
  .rank__balance { margin: 0; text-align: right; grid-column: 3; grid-row: 1; }
  .tool-layout { max-width: 46rem; }
  .story-list--wide { grid-template-columns: 1fr 1fr; gap: 1.25rem 2rem; }
}

@media (min-width: 64rem) {
  .top { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  .layout { grid-template-columns: minmax(0, 1fr) 20rem; gap: 3.5rem; align-items: start; }
  .layout__main { max-width: 44rem; }
  .sidebar { position: sticky; top: 6.5rem; }
  .top + .layout .rule-title:first-child, .layout__main > section:first-child > .rule-title { margin-top: 2.5rem; }
  .top + .layout .sidebar { margin-top: 2.5rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.stack-top { margin-top: 1.5rem; }
