/* Página de emendas parlamentares: reaproveita a linguagem visual do site (style.css). */
.pagina-emendas { overflow: auto; height: auto; }
.pagina-emendas .topo { position: sticky; top: 0; z-index: 30; }
.em { max-width: 1240px; margin: 0 auto; padding: 18px 18px 40px; }
.em-hero { padding: 26px 4px 18px; }
.em-hero__titulo { font-family: Newsreader, Georgia, serif; font-weight: 500; font-size: clamp(28px, 4.2vw, 44px); line-height: 1.08; margin: 0 0 10px; letter-spacing: -.01em; }
.em-hero__sub { color: var(--muted); max-width: 760px; margin: 0 0 18px; font-size: 15px; }
.em-hero--compacto .em-hero__titulo { font-size: clamp(22px, 3vw, 30px); }
.em-hero--compacto .em-hero__sub { display: none; }
.em-hero__numeros { display: flex; flex-wrap: wrap; gap: 10px; }
.em-num { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; min-width: 170px; }
.em-num b { display: block; font-family: Newsreader, Georgia, serif; font-size: 28px; font-weight: 500; line-height: 1; }
.em-num span { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.em-trilha { color: var(--muted); font-size: 13px; margin: 0 4px 12px; }
.em-trilha a { color: var(--muted); text-decoration: none; }
.em-trilha a:hover { color: var(--text); text-decoration: underline; }
.em-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.em .card { padding: 16px 18px; }
.em .card__sub { color: var(--muted); font-size: 12.5px; margin: 2px 0 10px; }

/* listas */
.em-lista { list-style: none; margin: 0; padding: 0; counter-reset: pos; }
.em-lista > li { border-top: 1px solid var(--border); }
.em-lista > li:first-child { border-top: 0; }
.em-lista > li > a { display: grid; grid-template-columns: auto minmax(0, 1fr) 90px auto; align-items: center; gap: 10px; padding: 9px 2px; color: inherit; text-decoration: none; border-radius: 8px; }
.em-lista > li > a:hover { background: var(--panel-2); }
.em-uf { width: 30px; font-weight: 700; color: var(--muted); font-size: 11.5px; }
.em-nome { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-barra { display: block; height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.em-barra i { display: block; height: 100%; background: linear-gradient(90deg, var(--pl, #3e63dd), #7c9cff); border-radius: 999px; }
.em-valores { text-align: right; min-width: 110px; }
.em-valores b { display: block; font-size: 14px; }
.em-valores small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }

/* autores */
.em-lista--autores > li { padding: 4px 0; }
.em-autor { display: grid; grid-template-columns: auto minmax(0, 1fr) 90px auto; align-items: center; gap: 10px; padding: 7px 2px; color: inherit; text-decoration: none; border-radius: 10px; }
.em-autor:hover { background: var(--panel-2); }
.em-foto { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--panel-3); border: 1.5px solid var(--border-2); flex: 0 0 auto; }
.em-foto--vazia { display: inline-block; }
.em-foto--icone { display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.em-foto--iniciais { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--c, var(--pl)); border-color: transparent; letter-spacing: .02em; }
.em-autor--grande .em-foto--iniciais { font-size: 24px; }
.em-busca__lista li .em-busca__uf { font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #3e63dd, #7c9cff); border-radius: 8px; }
.em-busca__lista li.item--uf .em-busca__uf { background: linear-gradient(135deg, #e5484d, #3e63dd); }
.em-busca__lista li.item--uf b { font-size: 15px; }
.em-autor__txt { min-width: 0; }
.em-autor__txt b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-autor__txt small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-autor--grande { grid-template-columns: auto minmax(0, 1fr); pointer-events: none; }
.em-autor--grande .em-foto { width: 72px; height: 72px; }
.em-autor--grande .em-autor__txt b { font-family: Newsreader, Georgia, serif; font-size: 26px; font-weight: 500; white-space: normal; }
.em-autor--grande .em-autor__txt small { font-size: 13px; }
.em-lista--autores .em-funcoes { margin: 0 0 8px 50px; }

/* funções */
.em-funcoes { list-style: none; margin: 0; padding: 0; }
.em-funcoes li { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.em-funcoes li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-funcoes li b { font-size: 13px; min-width: 80px; text-align: right; }

/* busca no cabeçalho */
.em-busca { position: relative; display: flex; align-items: center; gap: 8px; width: min(520px, 100%); padding: 0 12px; height: 36px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.em-busca svg { width: 16px; height: 16px; flex: 0 0 auto; }
.em-busca input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: inherit; }
.em-busca input::placeholder { color: var(--muted); }
.em-busca__lista { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--panel); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); max-height: 60vh; overflow: auto; z-index: 50; }
.em-busca__lista li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--text); }
.em-busca__lista li[aria-selected="true"], .em-busca__lista li:hover { background: var(--panel-2); }
.em-busca__lista img, .em-busca__ico { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--panel-3); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex: 0 0 auto; }
.em-busca__lista b { display: block; font-weight: 600; }
.em-busca__lista small { display: block; color: var(--muted); font-size: 11.5px; }
.em-rodape { padding: 22px 4px 0; flex-direction: column; gap: 8px; }

@media (max-width: 1080px) {
  .em-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .em { padding: 10px 12px 30px; }
  .em-hero { padding: 14px 2px 10px; }
  .em-num { min-width: calc(50% - 5px); flex: 1 1 auto; }
  .em-lista > li > a, .em-autor { grid-template-columns: auto minmax(0, 1fr) auto; }
  .em-lista .em-barra { display: none; }
  .em-lista--autores .em-funcoes { margin-left: 0; }
  .pagina-emendas .topo__centro { order: 3; width: 100%; }
}

/* filtros */
.em-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; }
.em-select { height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit; font-size: 13px; }

/* título */
.em-hero__ano { color: var(--muted); font-weight: 400; }
/* mapa */
.em-mapa { margin-bottom: 14px; padding: 14px 18px 8px; }
.em-mapa__cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.em-mapa__viewport { position: relative; height: clamp(320px, 52vw, 560px); }
.em-mapa__viewport svg { width: 100%; height: 100%; display: block; }
.em-mapa__viewport path.uf { stroke: var(--bg); stroke-width: .8; cursor: pointer; transition: filter .15s; }
.em-mapa__viewport path.uf:hover { filter: brightness(1.25); }
.em-mapa__viewport path.uf.sel { stroke: var(--text); stroke-width: 1.6; }
.em-mapa__viewport text { font: 700 11px Inter, sans-serif; fill: #fff; pointer-events: none; paint-order: stroke; stroke: rgba(0,0,0,.55); stroke-width: 3px; }
.em-mapa__viewport text.valor { font-weight: 500; font-size: 10px; }
.em-mapa__tip { position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow); z-index: 5; min-width: 160px; }
.em-mapa__tip b { display: block; font-size: 14px; }
.em-mapa__escala { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.em-mapa__escala i { display: block; width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #1b2a5a, #3e63dd, #9cb4ff); }
/* lista de emendas (detalhe) */
.em-tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.em-tabela th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; padding: 6px 6px; border-bottom: 1px solid var(--border); }
.em-tabela td { padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.em-tabela td.num, .em-tabela th.num { text-align: right; white-space: nowrap; }
.em-tabela a.doc { display: inline-block; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--text); text-decoration: none; font-size: 11.5px; white-space: nowrap; }
.em-tabela a.doc:hover { background: var(--panel-3); }
.em-tabela .sub { display: block; color: var(--muted); font-size: 11.5px; }
.em-pago { color: var(--ok); }
.em-naopago { color: var(--warn); }
@media (max-width: 760px) { .em-tabela th:nth-child(3), .em-tabela td:nth-child(3) { display: none; } }
.pill--gastos { border-color: #e5484d; color: #ff8a8e; }
.pill--gastos:hover { background: rgba(229, 72, 77, .15); }
.ga-botao { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ga-botao:hover { background: var(--panel-2); }
/* no celular, os atalhos do cabeçalho das páginas de emendas/gastos continuam com texto */
@media (max-width: 1080px) {
  .pagina-emendas .topo__direita .pill { width: auto; padding: 0 10px; }
  .pagina-emendas .topo__direita .pill span { display: inline; }
}
