:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --border: #dfe3e8;
  --accent: #0b6e4f;
  --accent-soft: #e3f2ec;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --danger: #b3261e;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1a1f25;
    --text: #e8ebef;
    --muted: #9aa4b0;
    --border: #2c333c;
    --accent: #3fbf8f;
    --accent-soft: #16302a;
    --warn: #f0b14a;
    --warn-soft: #33270f;
    --danger: #ff7b72;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--text); }
.logo span { color: var(--accent); }
nav a { margin-right: 16px; text-decoration: none; color: var(--muted); font-size: .95rem; }
nav a:hover, nav a.ativo { color: var(--accent); }
nav a.lang {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
nav a.lang:hover { border-color: var(--accent); }
.wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }
main { padding: 24px 0 48px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 8px 0 8px; }
h2 { font-size: 1.25rem; margin-top: 32px; }
.lead { color: var(--muted); margin-top: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
input, select {
  width: 100%;
  padding: 9px 10px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 3px; }
fieldset { border: none; padding: 0; margin: 0 0 18px; }
legend { font-weight: 600; margin-bottom: 10px; }
button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) { button { color: #0d1a15; } }
.resultado { display: none; }
.resultado.on { display: block; }
.destaque {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.destaque .valor { font-size: 1.8rem; font-weight: 700; }
.alerta { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabela-scroll { overflow-x: auto; }
.ad-slot {
  border: 1px dashed var(--border);
  color: var(--muted);
  text-align: center;
  font-size: .8rem;
  padding: 24px 8px;
  margin: 20px 0;
  border-radius: 8px;
}
.ferramentas a.card { display: block; text-decoration: none; color: var(--text); margin: 0; }
.ferramentas a.card:hover { border-color: var(--accent); }
.ferramentas h3 { margin: 0 0 4px; color: var(--accent); font-size: 1.05rem; }
.ferramentas p { margin: 0; color: var(--muted); font-size: .92rem; }
.tag { display: inline-block; font-size: .72rem; background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
footer { border-top: 1px solid var(--border); padding: 20px 0 32px; color: var(--muted); font-size: .85rem; }
.neg { color: var(--danger); }

/* Artigos */
article p, article li { max-width: 70ch; }
article h2 { border-top: 1px solid var(--border); padding-top: 24px; }
.meta { color: var(--muted); font-size: .85rem; margin-bottom: 20px; }
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  margin: 16px 0 24px;
  text-align: center;
  padding: 16px;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.linha-tempo { list-style: none; padding: 0; margin: 16px 0; border-left: 3px solid var(--accent); }
.linha-tempo li { padding: 4px 0 12px 18px; position: relative; }
.linha-tempo li::before { content: ""; position: absolute; left: -8px; top: 11px; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); }
.linha-tempo strong { display: block; color: var(--accent); }
.caixa { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; margin: 18px 0; }
.caixa.alerta-forte { background: var(--warn-soft); }
.secao-titulo { margin-top: 36px; }
.hero { padding: 16px 0 8px; }
.hero h1 { font-size: 2rem; }

/* ===== Visual "mercado financeiro" ===== */
:root { --hdr: #0b1726; --verde-vivo: #3fbf8f; --ouro: #d4a017; --vermelho: #d64545; }
@media (prefers-color-scheme: dark) { :root { --bg: #0b0f14; --hdr: #060b12; } }
body {
  background:
    radial-gradient(1100px 480px at 90% -8%, rgba(11,110,79,.12), transparent 60%),
    radial-gradient(900px 420px at -12% 30%, rgba(212,160,23,.09), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
header.site {
  background: var(--hdr);
  border-bottom: 2px solid var(--verde-vivo);
  position: sticky; top: 0; z-index: 20;
}
header.site .logo { color: #fff; }
header.site .logo::before { content: "▲"; color: var(--verde-vivo); font-size: .75em; margin-right: 6px; vertical-align: 2px; }
header.site .logo span { color: var(--verde-vivo); }
header.site nav a { color: rgba(230,237,245,.72); }
header.site nav a:hover, header.site nav a.ativo { color: #fff; }
header.site nav a.ativo { box-shadow: inset 0 -2px 0 var(--verde-vivo); }
header.site nav a.lang { color: #fff; border-color: rgba(255,255,255,.35); }
header.site nav a.lang:hover { border-color: var(--verde-vivo); }

.card { box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 6px 18px rgba(16,24,40,.05); }
.ferramentas a.card { border-top: 3px solid var(--accent); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.ferramentas a.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(16,24,40,.14); }
#historias + .grid a.card, #stories + .grid a.card { border-top-color: var(--vermelho); }
#calculadoras + .grid a.card, #calculators + .grid a.card { border-top-color: var(--ouro); }
.secao-titulo { display: flex; align-items: center; gap: 10px; }
.secao-titulo .ico { font-size: 1.3rem; }

/* Carrossel por seção (página inicial) */
.grid.carrossel {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 28px) / 3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 6px 2px 14px;
  scrollbar-width: thin;
}
.grid.carrossel > .card { scroll-snap-align: start; }
@media (max-width: 760px) { .grid.carrossel { grid-auto-columns: calc((100% - 14px) / 2); } }
@media (max-width: 520px) { .grid.carrossel { grid-auto-columns: 82%; } }
.setas { margin-left: auto; display: flex; gap: 6px; }
.setas button {
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  font-size: 1rem; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.setas button:hover { border-color: var(--accent); color: var(--accent); }
.setas button:disabled { opacity: .35; cursor: default; }
.contador { font-size: .8rem; font-weight: 400; color: var(--muted); }

/* Quadro de maiores altas e baixas */
.painel-mercado .grid-ab {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 6px 18px rgba(16,24,40,.05);
  min-height: 120px;
}
.ab-col ul { list-style: none; margin: 0; padding: 0; }
.ab-col li { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.ab-col li:last-child { border-bottom: none; }
.ab-titulo { margin: 0 0 6px; font-size: 1rem; }
.ab-cod { font-weight: 700; }
.ab-preco { color: var(--muted); }
.ab-var { font-weight: 600; min-width: 74px; text-align: right; }
.painel-mercado .up { color: var(--accent); }
.painel-mercado .down { color: var(--danger); }
.ab-nota { grid-column: 1 / -1; margin: 4px 0 0; font-size: .78rem; color: var(--muted); }
.ab-col li.vazio { display: block; color: var(--muted); }
@media (max-width: 600px) { .painel-mercado .grid-ab { grid-template-columns: 1fr; } }

/* Aviso de idioma */
.aviso-idioma { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; padding: 10px 16px; background: #12324a; color: #fff; font-size: .92rem; }
.aviso-idioma .btn { padding: 6px 14px; font-size: .88rem; }
.aviso-idioma button { background: transparent; color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.35); padding: 5px 12px; font-size: .85rem; font-weight: 500; }

/* Cotações rolando junto com os temas, na faixa fixa do cabeçalho */
.cot-ticker { font-variant-numeric: tabular-nums; }
.cot-ticker strong { color: #fff; margin-right: 4px; }
.cot-ticker .up, .cot-ticker .down { margin-left: 4px; }
.cot-sep { color: #7f93a8; margin: 0 2px; }
.cot-fonte { color: var(--muted); font-size: .78rem; margin-bottom: 8px; }

/* Faixa rolando (estilo letreiro de cotações) */
.ticker { background: #101e30; color: #cfe3f5; overflow: hidden; white-space: nowrap; font-size: .85rem; border-bottom: 1px solid #1c2f45; }
.ticker-track { display: inline-block; padding: 7px 0; animation: rolar 45s linear infinite; }
.ticker-track > span { margin: 0 22px; }
.ticker .up { color: var(--verde-vivo); }
.ticker .down { color: #ff7b72; }
@keyframes rolar { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* Capa da página inicial */
.hero-capa {
  position: relative; overflow: hidden;
  margin: 20px 0 8px; padding: 44px 28px 40px;
  border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #0b1726 0%, #12324a 55%, #0b4a37 100%);
  box-shadow: 0 14px 40px rgba(11,23,38,.25);
}
.hero-grafico { position: absolute; right: 0; bottom: 0; width: 70%; height: 75%; opacity: .55; pointer-events: none; }
.hero-capa > *:not(svg) { position: relative; }
.hero-kicker { display: inline-block; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--verde-vivo); background: rgba(63,191,143,.12); border: 1px solid rgba(63,191,143,.35); padding: 2px 10px; border-radius: 99px; }
.hero-capa h1 { font-size: 2.2rem; line-height: 1.15; margin: 14px 0 10px; max-width: 18ch; color: #fff; }
.hero-capa p { color: rgba(255,255,255,.85); max-width: 52ch; margin: 0 0 22px; font-size: 1.05rem; }
.hero-botoes { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; text-decoration: none; font-weight: 600; padding: 10px 18px; border-radius: 8px; background: var(--verde-vivo); color: #06231a; }
.btn:hover { filter: brightness(1.08); }
.btn.sec { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
@media (max-width: 560px) { .hero-capa { padding: 32px 18px; } .hero-capa h1 { font-size: 1.7rem; } .hero-grafico { width: 100%; opacity: .3; } }

/* Contato */
footer .btn-contato { display: inline-block; margin-top: 10px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--text, inherit); text-decoration: none; font-weight: 600; }
footer .btn-contato:hover { border-color: var(--verde-vivo); color: var(--verde-vivo); }
footer .wrap { display: flex; flex-direction: column; align-items: flex-start; }
.contato-caixa { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.contato-caixa p { margin: 0; }
.btn.desativado { opacity: .5; cursor: not-allowed; }

/* Fotos de pessoas nas histórias */
.foto-pessoa { float: right; width: 170px; margin: 4px 0 12px 20px; }
.foto-pessoa img { width: 100%; height: auto; border-radius: 10px; display: block; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.foto-pessoa figcaption { font-size: .72rem; line-height: 1.35; color: var(--muted); margin-top: 6px; }
.foto-pessoa figcaption a { color: inherit; }
article h2 { clear: both; }
@media (max-width: 560px) { .foto-pessoa { width: 120px; margin-left: 14px; } }
