/* Análise "Quem as pesquisas ouvem?" (complementa erro.css) */
:root { --lula: #b4424f; --flavio: #2f5da8; --plano: #3170FD; --amostra: #12b3a3;
  --h0: #d1fae5; --h1: #ecfccb; --h2: #fef3c7; --h3: #fed7aa; --h4: #fecaca; --h-ink: #111a2e; }
[data-theme="dark"] { --lula: #f87171; --flavio: #60a5fa; --plano: #60a5fa; --amostra: #2dd4bf;
  --h0: #064e3b; --h1: #365314; --h2: #713f12; --h3: #7c2d12; --h4: #7f1d1d; --h-ink: #f8fafc; }

/* ícone "i" que leva à metodologia */
.mi { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%;
  border: 1.4px solid currentColor; color: var(--text-tertiary); font: italic 700 10px/1 'Space Grotesk', Inter, sans-serif;
  text-decoration: none; vertical-align: 1px; margin-left: 2px; transition: color .15s; }
.mi:hover { color: var(--brand); }

.pf-fontes { margin-top: 16px; border-top: 1px solid var(--border-soft); padding-top: 12px; font-size: 13px; color: var(--text-secondary); }
.pf-fontes h3 { font-size: 14px; color: var(--text); margin-bottom: 6px; }
.pf-fontes ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }

/* gráficos */
.pf-serie { font: 600 12px Inter, sans-serif; fill: var(--text-secondary); }
.pf-lbl { font: 500 12px Inter, sans-serif; fill: var(--text); }
.pf-lbl.fraco { fill: var(--text-tertiary); }
.pf-val { font: 600 11.5px 'JetBrains Mono', monospace; fill: var(--text-secondary); }
.pf-row .row-hit { fill: transparent; }
.pf-row:hover .row-hit { fill: var(--bg-elev-2); }
.pf-ref { stroke: var(--text); stroke-width: 2; }
.pf-ref.alt { stroke: var(--text-tertiary); stroke-width: 1.4; stroke-dasharray: 4 3; }
.pf-ref-lbl { font: 600 10.5px Inter, sans-serif; fill: var(--text-tertiary); }
.pf-ref-lbl.main { fill: var(--text); }
.pf-link { stroke: var(--text-tertiary); stroke-width: 1.5; }
.pf-dot-plano { fill: var(--plano); stroke: var(--bg-elev); stroke-width: 1.5; }
.pf-dot-amostra { fill: none; stroke: var(--amostra); stroke-width: 2.5; }
.pf-bar.h0 { fill: #34d399; } .pf-bar.h1 { fill: #a3e635; } .pf-bar.h2 { fill: #fbbf24; } .pf-bar.h3 { fill: #fb923c; } .pf-bar.h4 { fill: #f87171; }
.pf-zero { stroke: var(--text); stroke-width: 1.5; }
.pf-link-r { stroke: var(--text-tertiary); stroke-width: 1.6; }
.pf-seta { fill: var(--text-tertiary); }
.pf-dot-pub { fill: var(--bg-elev); stroke: var(--text-secondary); stroke-width: 2; }
.pf-dot-aj { fill: var(--brand); stroke: var(--bg-elev); stroke-width: 1.5; }
.an-chart .grid line { stroke: var(--border-soft); }
.an-chart .axis text { font: 500 11px Inter, sans-serif; fill: var(--text-tertiary); }
.an-chart .axis path, .an-chart .axis line { stroke: var(--border-soft); }

/* legendas */
.pf-lg-plano, .pf-lg-amostra, .pf-lg-real, .pf-lg-pub, .pf-lg-aj { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.pf-lg-plano { background: var(--plano); }
.pf-lg-amostra { border: 2.5px solid var(--amostra); }
.pf-lg-real { width: 3px; height: 12px; border-radius: 1px; background: var(--text); }
.pf-lg-pub { border: 2px solid var(--text-secondary); }
.pf-lg-aj { background: var(--brand); }
.pf-legend-r { margin: 4px 0 2px; }
.pf-lg-note { color: var(--text-tertiary); }

/* tabela de distâncias */
.pf-busca { font: 500 13px Inter, sans-serif; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border-soft); background: var(--bg-elev); color: var(--text); min-width: 160px; }
.pf-heat td small, .pf-heat td strong + small { display: block; font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.pf-heat tbody tr, #tabRepond tbody tr { cursor: pointer; }
.pf-heat tbody tr:hover td, #tabRepond tbody tr:hover td { background: var(--bg-elev-2); }
.pf-heat tbody tr.sel td, #tabRepond tbody tr.sel td { box-shadow: inset 0 -2px 0 var(--brand); }
.pf-cel { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--h-ink); }
.pf-heat tbody tr:hover .pf-cel { filter: brightness(.97); }
.pf-cel.h0, .pf-escala .h0, .pf-d.h0 { background: var(--h0); } .pf-cel.h1, .pf-escala .h1, .pf-d.h1 { background: var(--h1); }
.pf-cel.h2, .pf-escala .h2, .pf-d.h2 { background: var(--h2); } .pf-cel.h3, .pf-escala .h3, .pf-d.h3 { background: var(--h3); }
.pf-cel.h4, .pf-escala .h4, .pf-d.h4 { background: var(--h4); }
.pf-cel.hn { color: var(--text-tertiary); font-weight: 500; }
.pf-escala .hn { background: transparent; border: 1px dashed var(--text-tertiary); }
.pf-def { font-size: 12px; color: var(--text-secondary); min-width: 200px; max-width: 280px; white-space: normal; line-height: 1.35; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after { content: ' ↕'; color: var(--text-tertiary); font-size: 10px; }
th.sortable.asc::after { content: ' ↑'; color: var(--brand); }
th.sortable.desc::after { content: ' ↓'; color: var(--brand); }
.pf-escala { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--text-secondary); margin-top: 10px; }
.pf-escala i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 6px; }

/* detalhe de um instituto */
.pf-detalhe:not(:empty) { margin-top: 16px; border: 1px solid var(--border-soft); border-radius: 16px; padding: 16px; background: var(--bg-elev-2); }
.pf-det-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.pf-det-head h3 { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 18px; }
.pf-det-head small { display: block; font: 500 12px Inter, sans-serif; color: var(--text-tertiary); margin-top: 2px; }
.pf-fechar { border: 1px solid var(--border-soft); background: var(--bg-elev); color: var(--text-secondary); width: 30px; height: 30px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; }
.pf-vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 10px; }
.pf-var { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px; min-width: 0; }
.pf-var h4 { font-size: 13.5px; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pf-var h4 small { font-weight: 500; color: var(--text-tertiary); font-size: 11.5px; }
.pf-d { font: 600 11px 'JetBrains Mono', monospace; padding: 2px 7px; border-radius: 6px; background: var(--bg-elev-2); color: var(--h-ink); margin-left: auto; }
.pf-cat { display: grid; grid-template-columns: minmax(90px, 1.2fr) minmax(70px, 1fr) 82px 42px; gap: 8px; align-items: center; font-size: 12px; padding: 3px 0; }
.pf-cat-l { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.pf-bars { display: flex; flex-direction: column; gap: 2px; }
.pf-bars i { display: block; height: 5px; border-radius: 3px; }
.b-alvo { background: var(--plano); } .b-real { background: var(--text-tertiary); }
.pf-cat-v { font: 600 11.5px 'JetBrains Mono', monospace; text-align: right; white-space: nowrap; }
.pf-cat-v small { color: var(--text-tertiary); font-weight: 500; }
.pf-cat-d { font: 600 11.5px 'JetBrains Mono', monospace; text-align: right; color: var(--text-tertiary); }
.pf-cat-d.big { color: var(--h-ink); background: var(--h2); border-radius: 5px; padding: 1px 4px; }
.pf-mini { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }
.pf-info { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin-top: 14px; font-size: 12.5px; }
.pf-info dt { font-weight: 600; color: var(--text-secondary); }
.pf-info dd { color: var(--text-secondary); }
.pf-mini-tab { font-size: 12px; }

/* achados */
.pf-achados { margin-top: 14px; font-size: 13.5px; color: var(--text-secondary); }
.pf-achados h3 { font-size: 15px; color: var(--text); margin-bottom: 6px; }
.pf-achados ul { padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }

/* reponderação */
.pf-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pf-chips-lbl { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.pf-chips button { font: 600 12px Inter, sans-serif; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-soft); background: var(--bg-elev); color: var(--text-tertiary); }
.pf-chips button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.pf-fl { color: var(--flavio); font-weight: 700; }
.pf-lu { color: var(--lula); font-weight: 700; }
.pf-conf { font: 700 10px/1 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: .05em; padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.pf-conf.alta { background: color-mix(in srgb, #12b3a3 16%, transparent); color: #0f766e; }
.pf-conf.media { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b45309; }
.pf-conf.baixa { background: color-mix(in srgb, #ef4444 16%, transparent); color: #b91c1c; }
[data-theme="dark"] .pf-conf.alta { color: #5eead4; } [data-theme="dark"] .pf-conf.media { color: #fcd34d; } [data-theme="dark"] .pf-conf.baixa { color: #fca5a5; }

@media (max-width: 640px) {
  .pf-cat { grid-template-columns: minmax(80px, 1fr) 64px 74px 38px; }
  .pf-info { grid-template-columns: 1fr; }
  .pf-vars { grid-template-columns: 1fr; }
}
