/* FtM Dados, sobre o design system dos sites do Follow the Money (ftm.app.br).
   Escuro é o padrão. Os tokens repetem os do design system (lps-ftm,
   src/components/site/ds/ftm-ds.css): mude lá primeiro e traga para cá.
   Os gráficos não leem nada daqui: fonte, paleta e fundo deles são os dos
   slides e moram no app.js. */
:root {
  --bg: #000000;                   /* preto */
  --surface: #111111;              /* superficie-1: cartões */
  --surface-2: #1A1A1A;            /* superficie-2: menus */
  --border: #333333;               /* linha: moldura de cartão */
  --border-soft: #222222;          /* divisórias entre blocos */
  --control-border: #707070;       /* linha-controle: borda de botão (3:1 no #111) */
  --ink: #F1F1F1;                  /* texto */
  --ink-2: #B3B3B3;                /* cinza-claro: texto secundário (9:1 no #111) */
  --accent: #0075FF;               /* azul da marca: só sobre o preto (5:1) */
  --accent-soft: #4098FF;          /* azul-75: azul como texto sobre #111 */
  --accent-fill: #1168CD;          /* azul-acao: fundo com texto branco (5,4:1) */
  --accent-wash: rgba(0, 117, 255, .14);
  --hover: rgba(255, 255, 255, .06);
  --glow: rgba(0, 117, 255, .24);
  --glow-2: rgba(64, 152, 255, .20);
  --grain-opacity: .18;
  --chart-bg: #000 url("assets/fundo.jpg") center / cover no-repeat;
  --logo: #F1F1F1;
  --shadow: 0 20px 40px 0 rgba(0, 0, 0, .3);   /* sombra-card */
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-editorial: Newsreader, Georgia, "Times New Roman", serif;
  --curva-saida: cubic-bezier(.22, 1, .36, 1);
  --raio-md: 10px;
  --raio-lg: 16px;
}
:root[data-theme="light"] {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #FFFFFF;
  --border: #DCDFE3;
  --border-soft: #E4E7EA;
  --control-border: #9AA3AB;
  --ink: #111111;
  --ink-2: #4F5A65;
  --accent: #1168CD;               /* o #0075FF puro fica abaixo de 4,5:1 no claro */
  --accent-soft: #1168CD;
  --accent-fill: #1168CD;
  --accent-wash: rgba(17, 104, 205, .10);
  --hover: rgba(17, 17, 17, .05);
  --glow: rgba(17, 104, 205, .12);
  --glow-2: rgba(64, 152, 255, .10);
  --grain-opacity: 0;
  --chart-bg: #ffffff;
  --logo: #111111;
  --shadow: 0 6px 20px rgba(20, 30, 40, .08);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; scroll-padding-top: 20px; }
html[data-theme="light"] { color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font); font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

/* Pular a barra lateral: fica fora da tela até receber foco pelo teclado. */
.pular {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  padding: 10px 16px; border-radius: var(--raio-md);
  background: var(--accent-fill); color: #fff; font-weight: 600; text-decoration: none;
  transform: translateY(-160%);
}
.pular:focus-visible { transform: none; }

/* ---------- esqueleto: barra lateral + conteúdo ---------- */
.app { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }

.lateral {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin;
  background: var(--bg); border-right: 1px solid var(--border-soft);
  padding: 24px 16px 20px; display: flex; flex-direction: column; gap: 24px;
}
.lateral-corpo { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; }
.marca { display: flex; align-items: center; gap: 8px; }
.marca-logo { display: block; color: var(--logo); flex: 1 1 auto; min-width: 0; text-decoration: none; }
.logo { display: block; width: 112px; line-height: 0; }
.logo svg { width: 100%; height: auto; }
.lateral-rotulo {
  margin: 0; padding: 0 8px; color: var(--ink-2);
  font-size: 12px; font-weight: 700; line-height: 16px; letter-spacing: .08em; text-transform: uppercase;
}

.icon-btn {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px;
  border-radius: var(--raio-md); border: 1px solid var(--border);
  background: transparent; color: var(--ink); cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.icon-btn:hover { border-color: var(--control-border); background: var(--hover); }
.icon-btn[hidden] { display: none; }
.ico-lua { display: none; }
:root[data-theme="light"] .ico-sol { display: none; }
:root[data-theme="light"] .ico-lua { display: block; }
#tela-cheia-pagina .ico-sair { display: none; }
#tela-cheia-pagina[aria-pressed="true"] .ico-entrar { display: none; }
#tela-cheia-pagina[aria-pressed="true"] .ico-sair { display: block; }
/* o botão de temas só existe no celular, onde o menu vira gaveta */
.menu-temas { display: none; }
.menu-temas .ico-fechar { display: none; }
.menu-temas[aria-expanded="true"] .ico-abrir { display: none; }
.menu-temas[aria-expanded="true"] .ico-fechar { display: block; }

/* ---------- navegação (categoria > subcategoria > gráfico) ---------- */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-grupo, .nav-sub { display: flex; flex-direction: column; }
.nav-rotulo, .nav-sub-rotulo {
  position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 8px; border-radius: var(--raio-md); color: var(--ink);
  transition: background-color .15s, color .15s;
}
.nav-rotulo::-webkit-details-marker, .nav-sub-rotulo::-webkit-details-marker { display: none; }
.nav-rotulo { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; }
.nav-sub-rotulo { font-size: 13.5px; color: var(--ink-2); padding-left: 20px; }
/* terceiro nível (empresa > assunto > gráfico): um degrau a mais de recuo */
.nav-sub .nav-sub > .nav-sub-rotulo { padding-left: 34px; }
.nav-sub .nav-sub > a { margin-left: 41px; }
.nav-sub .nav-sub .nav-sub > .nav-sub-rotulo { padding-left: 48px; }
.nav-sub .nav-sub .nav-sub > a { margin-left: 55px; }
.nav-rotulo:hover, .nav-sub-rotulo:hover { background: var(--hover); color: var(--ink); }
/* a categoria que está na tela acende no menu: traço azul à esquerda */
.nav-grupo[data-atual="true"] > .nav-rotulo::before {
  content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 2px;
  border-radius: 2px; background: var(--accent);
}
.nav-grupo[data-atual="true"] > .nav-rotulo { color: var(--ink); background: var(--hover); }
/* A contagem não quebra e não herda o peso do rótulo; o nome é que quebra
   em linhas quando os dois não cabem juntos. */
.nav-rotulo > span:not(.nav-conta) { flex: 1 1 0; min-width: min-content; }
.nav-conta {
  margin-left: auto; font-size: 12px; font-weight: 400; color: var(--ink-2);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.nav a {
  display: block; margin-left: 27px; padding: 6px 8px 6px 12px;
  border-left: 1px solid var(--border-soft);
  color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 300; line-height: 1.35;
  transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--ink); border-left-color: var(--accent); }
.seta { flex: none; color: var(--ink-2); transition: transform .2s var(--curva-saida); }
details[open] > summary > .seta, details[open] > .nav-rotulo > .seta, details[open] > .nav-sub-rotulo > .seta { transform: rotate(90deg); }

.lateral-rodape {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft);
  color: var(--ink-2); font-size: 12.5px; font-weight: 300; line-height: 1.5;
}
.fontes-rotulo {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 8px; border-radius: var(--raio-md); color: var(--ink-2);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  transition: background-color .15s, color .15s;
}
.fontes-rotulo::-webkit-details-marker { display: none; }
.fontes-rotulo:hover { background: var(--hover); color: var(--ink); }
.fontes p { margin: 0 0 8px; padding: 0 8px 0 29px; }
.fontes p:last-child { margin-bottom: 4px; }

/* ---------- conteúdo ---------- */
/* o gráfico é 16:9: a largura daqui é que decide a altura dele */
.conteudo { min-width: 0; max-width: 1200px; padding: 0 32px 80px; overflow-x: clip; }

/* Abertura: a atmosfera dos sites (brilho azul nas bordas e grão de filme)
   atrás do título editorial. O brilho sangra até as bordas da coluna. */
.abertura { position: relative; isolation: isolate; padding: 64px 0 44px; }
.abertura::before {
  content: ""; position: absolute; inset: 0 -32px; z-index: -2; pointer-events: none;
  background:
    radial-gradient(46% 70% at 0% 0%, var(--glow-2), transparent 72%),
    radial-gradient(40% 60% at 100% 0%, var(--glow), transparent 70%),
    linear-gradient(180deg, transparent 55%, var(--bg));
  animation: respira 9s cubic-bezier(.4, 0, .2, 1) infinite alternate;
}
.abertura::after {
  content: ""; position: absolute; inset: 0 -32px; z-index: -1; pointer-events: none;
  opacity: var(--grain-opacity); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent);
  mask-image: linear-gradient(180deg, #000 50%, transparent);
}
@keyframes respira { from { opacity: .8; } to { opacity: 1; } }

/* azul-75: o sobrancelha fica sobre o brilho, onde o #0075FF cai abaixo de 4,5:1 */
.sobrancelha {
  margin: 0 0 14px; color: var(--accent-soft);
  font-size: 12px; font-weight: 700; line-height: 16px; letter-spacing: .08em; text-transform: uppercase;
}
/* Título editorial: Newsreader regular com a palavra-chave em itálico negrito
   azul, a assinatura dos títulos do site. */
.titulo-pagina {
  margin: 0 0 16px; font-family: var(--font-editorial); font-weight: 400;
  font-variation-settings: "opsz" 72;
  font-size: clamp(2.375rem, 4.2vw, 3.5rem); line-height: 1.04; letter-spacing: -.015em;
  color: var(--ink); text-wrap: balance;
}
.titulo-pagina em { font-style: italic; font-weight: 700; color: var(--accent); }
.lede {
  margin: 0; max-width: 40rem; color: var(--ink-2);
  font-size: clamp(1.0625rem, 1.1vw, 1.125rem); font-weight: 300; line-height: 1.6; text-wrap: pretty;
}

/* Resumo da página: números reais, contados dos arquivos de dados. */
.resumo {
  display: flex; flex-wrap: wrap; gap: 14px 0; margin: 32px 0 0; padding: 0; list-style: none;
}
.resumo[hidden] { display: none; }
.resumo li {
  display: grid; gap: 2px; padding: 0 28px; border-left: 1px solid var(--border);
}
.resumo li:first-child { padding-left: 0; border-left: 0; }
.resumo strong {
  font-size: clamp(1.625rem, 2.2vw, 2rem); font-weight: 700; line-height: 1.1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.resumo span { font-size: 13px; color: var(--ink-2); }

.graficos { display: flex; flex-direction: column; }
.estado { color: var(--ink-2); text-align: center; padding: 40px 0; font-weight: 300; }
.estado.erro { color: #ff8d7a; }

/* categoria e seção, as duas retráteis */
.categoria { border-top: 1px solid var(--border-soft); }
.categoria:last-child { border-bottom: 1px solid var(--border-soft); }
.categoria-rotulo, .secao-rotulo {
  display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none;
  margin: 0; color: var(--ink);
}
.categoria-rotulo::-webkit-details-marker, .secao-rotulo::-webkit-details-marker { display: none; }
/* A categoria é um título de seção do site: Newsreader, com a contagem e a
   seta num círculo à direita. */
.categoria-rotulo {
  padding: 22px 0; font-family: var(--font-editorial); font-weight: 400;
  font-variation-settings: "opsz" 72;
  font-size: clamp(1.625rem, 2.5vw, 2.125rem); line-height: 1.1; letter-spacing: -.01em;
}
.categoria-titulo { flex: 1 1 auto; min-width: 0; margin: 0; font: inherit; letter-spacing: inherit; }
.categoria-conta {
  font-family: var(--font); font-size: 13px; font-weight: 400; letter-spacing: 0;
  color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.categoria-rotulo > .seta {
  order: 3; width: 40px; height: 40px; padding: 13px;
  border: 1px solid var(--border); border-radius: 50%; color: var(--ink);
  transition: transform .2s var(--curva-saida), border-color .15s, background-color .15s;
}
.categoria-rotulo:hover > .seta { border-color: var(--accent); background: var(--accent-wash); }
.categoria[open] > .categoria-rotulo { padding-bottom: 12px; }
.secao { margin: 0 0 8px 6px; padding-left: 22px; border-left: 1px solid var(--border-soft); }
.secao-rotulo {
  gap: 8px; padding: 10px 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  transition: color .15s;
}
.secao-rotulo:hover { color: var(--accent); }
.secao-graficos { display: grid; gap: 20px; padding: 8px 0 24px; }

/* ---------- cartão do gráfico (retrátil) ---------- */
/* Sem overflow: hidden aqui. Ele existia só para o desenho não vazar dos
   cantos arredondados, mas também cortava o menu de baixar quando ele caía
   fora da caixa do cartão. Agora quem recorta é o .frame, e cada elemento que
   pode ser o último arredonda a própria base. */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--raio-lg); box-shadow: var(--shadow);
  transition: border-color .2s;
}
.card:hover { border-color: rgba(64, 152, 255, .45); }
.card-cabecalho {
  display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
  padding: 16px 18px; border-radius: 15px 15px 0 0;
}
.card-cabecalho::-webkit-details-marker { display: none; }
.card:not([open]) > .card-cabecalho { border-radius: 15px; }
.card-titulo { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.card-sub { margin: 3px 0 0; font-size: 13.5px; font-weight: 300; color: var(--ink-2); line-height: 1.35; }
.card-tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 18px 14px;
}
.card-acoes { display: flex; align-items: center; gap: 8px; }
.card-escolhas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.card-escolhas .periodos + .periodos { border-left: 1px solid var(--border); padding-left: 12px; }
.card-escolhas .periodos[hidden] { display: none; }
.periodos { display: flex; flex-wrap: wrap; gap: 6px; }

/* Botões: o chip do design system (borda de controle, raio 10, Inter). */
.periodos button, .btn, .series button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer;
  background: transparent; border: 1px solid var(--control-border); border-radius: var(--raio-md); padding: 0 12px;
  transition: border-color .15s, background-color .15s, color .15s;
}
.periodos button:hover, .btn:hover, .series button:hover { border-color: var(--ink-2); background: var(--hover); }
/* escolhido: azul cheio com texto branco */
.periodos button[aria-pressed="true"] { color: #fff; background: var(--accent-fill); border-color: var(--accent-fill); }

/* seleção de séries: o mesmo chip, com a cor da linha na frente. Desligada,
   a tinta perde a cor e o texto fica no cinza secundário (ainda acima de
   4,5:1). */
.series { display: flex; flex-wrap: wrap; gap: 6px; }
.series button { font-weight: 400; color: var(--ink-2); }
.series button[aria-pressed="true"] { color: var(--ink); border-color: var(--accent-soft); background: var(--accent-wash); }
.series button[aria-pressed="false"] .tinta { background: var(--ink-2) !important; opacity: .4; }
.series .tinta { width: 12px; height: 12px; border-radius: 3px; flex: none; }

.baixar { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; min-width: 260px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--raio-md);
  box-shadow: var(--shadow); padding: 6px;
}
.menu[hidden] { display: none; }
.menu button {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 14px;
  color: var(--ink); background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer;
}
.menu button:hover, .menu button:focus-visible { background: var(--hover); }
.menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.menu small { display: block; color: var(--ink-2); font-size: 12px; font-weight: 300; }
.menu-rotulo { display: block; padding: 6px 10px 8px; font-size: 12px; color: var(--ink-2); }
.menu-tamanho {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--control-border); border-radius: 8px; padding: 6px 8px;
}
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }

.frame {
  position: relative; background: var(--chart-bg);
  border-top: 1px solid var(--border); overflow: hidden;
}
.card > .frame:last-child { border-radius: 0 0 15px 15px; }
.frame svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.nota { margin: 0; padding: 12px 18px; color: var(--ink-2); font-size: 13.5px; font-weight: 300; border-top: 1px solid var(--border); }
.card > .nota:last-child { border-radius: 0 0 15px 15px; }
/* nota de vários parágrafos: a linha divisória é só a do primeiro */
.nota + .nota { border-top: 0; padding-top: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* anel de foco do design system: contorno azul de 2px afastado 3px */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- entrada: a página se monta de cima para baixo ---------- */
.abertura > * { animation: sobe .65s var(--curva-saida) both; }
.abertura > :nth-child(2) { animation-delay: .06s; }
.abertura > :nth-child(3) { animation-delay: .12s; }
.abertura > :nth-child(4) { animation-delay: .18s; }
@keyframes sobe { from { opacity: 0; transform: translateY(14px); } }
/* as categorias entram ao aparecer na tela, uma depois da outra (o app.js
   põe .revela e, ao entrar na tela, .is-in com o atraso de cada uma) */
.revela { opacity: 0; transform: translateY(14px); transition: opacity .65s var(--curva-saida), transform .65s var(--curva-saida); }
.revela.is-in { opacity: 1; transform: none; }

/* ---------- visor: um gráfico grande, com anotação à mão ---------- */
body.visor-aberto { overflow: hidden; }
.visor {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 56px 24px;
}
.visor[hidden] { display: none; }

/* O palco tem a proporção do layout desenhado (--ar): a largura é a menor
   entre a que cabe na janela e a que a altura permite, e o SVG e o canvas de
   anotação ocupam 100% dele. Assim os dois ficam sempre sobrepostos. */
.visor-palco {
  position: relative; line-height: 0; aspect-ratio: var(--ar, 1.7778);
  width: min(calc(100vw - 48px), calc((100vh - 118px) * var(--ar, 1.7778)));
  background: var(--chart-bg); border-radius: var(--raio-md); overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5), 0 0 0 1px var(--border);
}
.visor-palco svg { display: block; width: 100%; height: 100%; }
.visor-tela { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; pointer-events: none; }
.visor.desenhando .visor-tela { pointer-events: auto; cursor: crosshair; }

.visor-barra {
  position: absolute; top: 16px; left: 22px; z-index: 1;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: calc(100% - 90px);
}
.visor-barra-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* recortes do gráfico: continuam à vista em tela cheia (o resto vira hambúrguer) */
.visor-recortes { display: flex; gap: 6px; flex-wrap: wrap; order: 2; }
.visor-recortes[hidden] { display: none; }
.visor-menu-caixa { order: 1; }
/* Botões do visor: vidro sobre o escuro, como os botões de vidro do site. */
.visor-btn, .visor-baixar, .visor-menu-btn, .visor-fechar {
  font: inherit; font-size: 14px; font-weight: 500; color: #fff; cursor: pointer;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color .15s, border-color .15s;
}
.visor-btn { min-height: 36px; border-radius: var(--raio-md); padding: 0 14px; }
.visor-btn:hover, .visor-baixar:hover, .visor-fechar:hover { background: rgba(255, 255, 255, .16); }
.visor-btn[aria-pressed="true"] { background: #1168CD; border-color: #1168CD; }
.visor-dica { font-size: 13px; color: rgba(255, 255, 255, .7); }

/* O menu de hambúrguer só existe em tela cheia (regras :fullscreen abaixo):
   fora dela os botões ficam soltos na margem escura, sem atrapalhar nada. */
.visor-menu-caixa { display: none; position: relative; }
.visor-menu-btn {
  width: 36px; height: 36px; padding: 0; border-radius: var(--raio-md);
  display: flex; align-items: center; justify-content: center;
}
.visor-menu-btn:hover, .visor-menu-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .2); }
.visor-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 2;
  display: flex; flex-direction: column; gap: 2px; min-width: 200px;
  background: rgba(17, 17, 17, .96); border: 1px solid #333;
  border-radius: var(--raio-md); padding: 6px; box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
.visor-menu[hidden] { display: none; }
.visor-menu button {
  font: inherit; font-size: 14px; color: #fff; text-align: left;
  background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer;
}
.visor-menu button:hover { background: rgba(255, 255, 255, .1); }

/* z-index: o palco vem depois no HTML e é position:relative; sem isto, um
   controle que caia dentro da área do gráfico fica escondido atrás dele */
.visor-fechar {
  position: absolute; z-index: 1; top: 16px; right: 22px; width: 40px; height: 40px; border-radius: 50%;
  font-size: 16px; line-height: 1;
}
.visor-baixar {
  position: absolute; z-index: 1; bottom: 18px; left: 50%; transform: translateX(-50%);
  min-height: 36px; border-radius: var(--raio-md); padding: 0 16px;
}

/* setas para o gráfico anterior e o seguinte, no meio das laterais */
.visor-seta {
  position: absolute; z-index: 1; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; color: #fff; cursor: pointer;
  background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .25);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color .15s, opacity .25s ease;
}
.visor-seta:hover { background: rgba(255, 255, 255, .18); }
.visor-seta[hidden] { display: none; }
.visor-seta-ant { left: 14px; }
.visor-seta-prox { right: 14px; }
.visor.chrome-oculto .visor-seta { opacity: 0; pointer-events: none; }
@media (max-width: 860px) { .visor-seta { width: 40px; height: 40px; } .visor-seta-ant { left: 6px; } .visor-seta-prox { right: 6px; } }

/* Tela cheia: o gráfico vale a tela inteira e os controles passam a flutuar
   sobre ele. Daí o fundo escuro opaco, o menu de hambúrguer no lugar dos
   botões soltos e o sumiço automático depois de um tempo parado.
   `:fullscreen` e `:-webkit-full-screen` em blocos separados de propósito: um
   seletor desconhecido dentro de uma lista invalida a lista inteira. */
.visor:fullscreen { padding: 0; background: #000; }
.visor:-webkit-full-screen { padding: 0; background: #000; }
.visor:fullscreen .visor-palco {
  width: min(100vw, calc(100vh * var(--ar, 1.7778))); border-radius: 0; box-shadow: none;
}
.visor:-webkit-full-screen .visor-palco {
  width: min(100vw, calc(100vh * var(--ar, 1.7778))); border-radius: 0; box-shadow: none;
}
.visor:fullscreen .visor-btn, .visor:fullscreen .visor-menu-btn,
.visor:fullscreen .visor-fechar, .visor:fullscreen .visor-baixar { background: rgba(0, 0, 0, .74); }
.visor:-webkit-full-screen .visor-btn, .visor:-webkit-full-screen .visor-menu-btn,
.visor:-webkit-full-screen .visor-fechar, .visor:-webkit-full-screen .visor-baixar { background: rgba(0, 0, 0, .74); }
.visor:fullscreen .visor-btn[aria-pressed="true"] { background: #1168CD; }
.visor:-webkit-full-screen .visor-btn[aria-pressed="true"] { background: #1168CD; }
.visor:fullscreen .visor-dica { color: rgba(255, 255, 255, .85); text-shadow: 0 1px 3px #000; }
.visor:-webkit-full-screen .visor-dica { color: rgba(255, 255, 255, .85); text-shadow: 0 1px 3px #000; }
.visor:fullscreen .visor-barra-inline { display: none; }
.visor:-webkit-full-screen .visor-barra-inline { display: none; }
.visor:fullscreen .visor-menu-caixa { display: flex; }
.visor:-webkit-full-screen .visor-menu-caixa { display: flex; }

.visor:fullscreen .visor-barra, .visor:fullscreen .visor-fechar, .visor:fullscreen .visor-baixar {
  transition: opacity .25s ease;
}
.visor:fullscreen.chrome-oculto .visor-barra,
.visor:fullscreen.chrome-oculto .visor-fechar,
.visor:fullscreen.chrome-oculto .visor-baixar { opacity: 0; pointer-events: none; }
.visor:-webkit-full-screen.chrome-oculto .visor-barra,
.visor:-webkit-full-screen.chrome-oculto .visor-fechar,
.visor:-webkit-full-screen.chrome-oculto .visor-baixar { opacity: 0; pointer-events: none; }

/* escolha do período arrastando: a dica ocupa o lugar dos antigos botões de
   20/10/5 anos e vira o recorte escolhido quando há um */
.periodos-dica { font-size: 13px; font-weight: 300; color: var(--ink-2); align-self: center; }
.periodos-dica.escolhido { color: var(--ink); font-weight: 600; }
.periodos button[hidden] { display: none; }

/* ---------- a barra lateral é um cabeçalho com gaveta, em qualquer tela ----------
   A lista de temas fica escondida e abre pelo botão "Temas"; antes ela era
   uma coluna fixa de 280px no computador. */
.app { grid-template-columns: minmax(0, 1fr); }
.lateral {
  position: sticky; top: 0; z-index: 40; height: auto; overflow: visible;
  padding: 12px 16px; gap: 0; border-right: 0; border-bottom: 1px solid transparent;
  background: transparent; transition: background-color .25s, border-color .25s;
}
/* rolou ou abriu a gaveta: o cabeçalho ganha o fundo com desfoque do site */
.lateral[data-rolado="true"], .lateral[data-aberto="true"] {
  background: rgba(0, 0, 0, .85); border-bottom-color: var(--border);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
:root[data-theme="light"] .lateral[data-rolado="true"],
:root[data-theme="light"] .lateral[data-aberto="true"] { background: rgba(244, 245, 247, .9); }
.logo { width: 96px; }
.menu-temas { display: inline-grid; }
.lateral-corpo {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 16px 24px; gap: 10px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  box-shadow: 0 24px 40px rgba(0, 0, 0, .45);
}
.lateral[data-aberto="true"] .lateral-corpo { display: flex; }
.nav-grupo[data-atual="true"] > .nav-rotulo::before { left: -8px; }
.lateral-rodape { margin-top: 12px; }

/* computador: a gaveta é um painel à direita, embaixo do botão, e o conteúdo
   fica no meio da tela */
@media (min-width: 861px) {
  .lateral { padding: 12px 32px; }
  .logo { width: 112px; }
  .lateral-corpo {
    left: auto; right: 24px; top: calc(100% + 6px); width: 360px; max-height: calc(100vh - 80px);
    border: 1px solid var(--border); border-radius: var(--raio-md);
  }
  .menu-temas { width: auto; padding: 0 12px; gap: 8px; grid-auto-flow: column; }
  .menu-temas-rotulo { font: inherit; font-size: 14px; font-weight: 500; }
  .conteudo { margin: 0 auto; width: 100%; }
  .nav-grupo[data-atual="true"] > .nav-rotulo::before { left: -8px; }
}
.menu-temas-rotulo { display: none; }
@media (min-width: 861px) { .menu-temas-rotulo { display: inline; } }

@media (max-width: 860px) {
  .conteudo { padding: 0 16px 56px; }
  .abertura { padding: 28px 0 32px; }
  .abertura::before, .abertura::after { inset: -72px -16px 0; }
  .resumo li { padding: 0 18px; }
  .card-cabecalho { padding: 14px; }
  .card-tools { padding: 0 12px 12px; }
  .nota { padding: 10px 14px; }
  .secao { margin-left: 2px; padding-left: 14px; }
  .visor { padding: 44px 10px; }
  .visor-palco { width: min(calc(100vw - 20px), calc((100vh - 96px) * var(--ar, 1.7778))); }
}

/* Tela estreita: a contagem desce para baixo do nome da categoria, e o
   nome ganha a largura toda até a seta. */
@media (max-width: 520px) {
  .categoria-rotulo {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px;
    padding: 18px 0;
  }
  .categoria-titulo { grid-column: 1; grid-row: 1; }
  .categoria-conta { grid-column: 1; grid-row: 2; }
  .categoria-rotulo > .seta { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .seta, .categoria-rotulo > .seta { transition: none; }
  .abertura::before { animation: none; }
  .abertura > * { animation: none; }
  .revela { opacity: 1; transform: none; transition: none; }
  .visor:fullscreen .visor-barra, .visor:fullscreen .visor-fechar, .visor:fullscreen .visor-baixar { transition: none; }
}

/* ---------- toque ----------
   Em tela de toque, todo controle chega a 44px (o mínimo do design system do
   FtM e das diretrizes de acessibilidade). No mouse, a densidade fica. */
button, summary, a, input, select { touch-action: manipulation; }
@media (pointer: coarse) {
  .icon-btn, .visor-menu-btn, .visor-fechar { width: 44px; height: 44px; }
  .periodos button, .btn, .series button, .visor-btn, .visor-baixar,
  .menu button, .menu-tamanho, .visor-menu button { min-height: 44px; }
  .nav-rotulo, .nav-sub-rotulo, .fontes-rotulo, .nav a { min-height: 44px; }
  .nav a { display: flex; align-items: center; }
  .categoria-rotulo > .seta { width: 44px; height: 44px; padding: 15px; }
}

/* ───────────────────────────────────────────────────────────────────────────
   Portão de assinante: mesmo desenho do Follow the News
   (lps-ftm/src/components/news/follow-the-news.css), reescrito em CSS puro.
   Sempre escuro, independente do tema do site: é a porta, não o conteúdo. */
.gate {
  position: fixed; inset: 0; z-index: 100; background: #000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px calc(24px + env(safe-area-inset-right)) 24px calc(24px + env(safe-area-inset-left));
}
.gate[hidden] { display: none; }
.gate-brilho {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(1, 117, 255, .12) 0%, transparent 60%);
}
.gate-caixa { position: relative; z-index: 1; width: 100%; max-width: 400px; text-align: center; }
.gate-logo { display: block; height: 28px; margin: 0 auto 24px; color: #f5f5f5; }
.gate-logo svg { height: 100%; width: auto; }
.gate-cadeado {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 20px; border-radius: 50%;
  border: 1px solid rgba(1, 117, 255, .3); background: rgba(1, 117, 255, .1); color: #0175ff;
}
.gate-titulo {
  margin: 0 0 8px; font-size: 30px; font-weight: 800;
  letter-spacing: -.025em; line-height: 1.05; color: #f5f5f5;
}
.gate-titulo span { color: #0175ff; }
.gate-sobrancelha {
  margin: 0 0 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .22em; color: #8c8c8c;   /* 6:1 no preto; o #6b6b6b ficava em 3,9:1 */
}
.gate-texto {
  margin: 0 auto 28px; max-width: 330px;
  font-size: 13.5px; line-height: 1.6; color: #a6a6a6;
}
.gate-form { max-width: 330px; margin: 0 auto; }
.gate-email {
  width: 100%; box-sizing: border-box; padding: 12px 16px; text-align: center;
  font: inherit; font-size: 14px; color: #f5f5f5;
  background: #0e0e0e; border: 1px solid #272727; border-radius: 11px;
  transition: border-color .2s;
}
.gate-email::placeholder { color: #8c8c8c; }
/* um anel só, o do design system: a borda azul por dentro dobrava a linha */
.gate-email:focus-visible { outline: 2px solid #0175ff; outline-offset: 3px; }
.gate-erro {
  margin-top: 16px; padding: 16px; text-align: left; border-radius: 8px;
  border: 1px solid rgba(229, 72, 77, .3); background: rgba(229, 72, 77, .05);
  font-size: 13px; line-height: 1.5; color: rgba(229, 72, 77, .9);
}
.gate-erro[hidden] { display: none; }
.gate-erro .assine { display: block; margin-top: 8px; color: #a6a6a6; }
.gate-erro .assine a { color: #0175ff; text-decoration: underline; text-underline-offset: 2px; }
.gate-botao {
  width: 100%; margin-top: 20px; padding: 14px 24px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: #fff; background: #0175ff; border: 0; border-radius: 11px;
  transition: background .2s, opacity .2s;
}
.gate-botao:hover:not(:disabled) { background: #0060dd; }
.gate-botao:disabled { opacity: .4; cursor: not-allowed; }

/* Com o portão aberto, o site não existe: nada de ler o conteúdo por baixo. */
.app[hidden] { display: none; }

/* Antes da pintura: o index.html marca <html data-portao> quando a página vai
   pedir e-mail, para o esqueleto do chart book não aparecer e sumir. Entre a
   pintura e o app.js a tela fica preta, que é a cor do portão, e não um
   lampejo do conteúdo. O app.js tira a marca ao liberar. */
:root[data-portao] .app { display: none; }

/* Compartilhar: o botão abre a lista das quatro redes, cada uma com o
   ícone num círculo de contorno (o desenho que ele gostou na Oaktree). */
.menu-redes .item-rede { display: flex; align-items: center; gap: 12px; }
.menu-redes .rede-ico {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 1px solid var(--control-border); border-radius: 50%; color: var(--ink);
}
.menu-redes .item-rede:hover .rede-ico { border-color: var(--ink-2); }
.menu-redes .item-rede-txt { display: flex; flex-direction: column; text-align: left; }
.compartilhar { position: relative; }
.aviso-curto { position: absolute; right: 0; top: 100%; margin-top: 6px; font-size: 12px; color: var(--ink-2);
  background: var(--hover); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; z-index: 5;
  white-space: nowrap; }
/* em tela estreita o botão fica só com o ícone, para a fileira não quebrar */
@media (max-width: 520px) {
  .compartilhar > .btn span { display: none; }
}

/* Zoom, Tela cheia, Compartilhar e Baixar numa linha só no celular: o rótulo
   não quebra, e o respiro lateral encolhe */
@media (max-width: 520px) {
  .card-acoes { gap: 6px; }
  .card-acoes .btn { white-space: nowrap; padding: 0 9px; }
}
