/* Aba única FUNIS — usa a paleta da dashboard (--blue, --green, --yellow, --red, --panel, --panel-soft, --line, --muted). */
#funnels-page > :not(#funnels-hub) { display: none !important; }
/* A barra do Google Ads (conta SP1) vazava para cima da página Funis. */
body:has(#funnels-page:not([hidden])) #roi-site-label,
body:has(#funnels-page:not([hidden])) #roi-source-context { display: none !important; }

#funnels-hub { --fh-radius: 14px; display: grid; gap: 22px; min-width: 0; font-size: .92rem; line-height: 1.45; }
#funnels-hub * { box-sizing: border-box; }
#funnels-hub h3, #funnels-hub h4, #funnels-hub h5 { margin: 0; letter-spacing: 0; }
#funnels-hub a { color: var(--blue, #54b6ff); text-decoration: none; }
#funnels-hub a:hover { text-decoration: underline; }
#funnels-hub [hidden] { display: none !important; }
.fh-note { color: var(--muted, #93a4ba); font-size: .82rem; margin: 8px 0 0; }
.fh-warn { color: var(--yellow, #ffcf70); font-size: .82rem; }
.fh-sub { color: var(--muted, #93a4ba); font-size: .82rem; }
.fh-sechead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 12px; }
.fh-sechead h3 { font-size: 1.15rem; }

/* Resumo */
.fh-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.fh-stat { flex: 1 1 140px; background: var(--panel, #131d2d); border: 1px solid var(--line, #26364e); border-radius: 12px; padding: 12px 16px; display: grid; gap: 2px; }
.fh-stat b { font-size: 1.55rem; line-height: 1.1; font-weight: 650; }
.fh-stat span { color: var(--muted, #93a4ba); font-size: .8rem; }

/* Busca */
.fh-searchbar input, .fh-filters select { width: 100%; min-height: 40px; border-radius: 10px; border: 1px solid var(--line, #26364e); background: var(--panel, #131d2d); color: inherit; padding: 0 12px; font: inherit; }
.fh-searchbar input::placeholder { color: var(--muted, #93a4ba); }
.fh-searchbar input:focus, .fh-filters select:focus { outline: 2px solid var(--blue, #54b6ff); outline-offset: 1px; }
.fh-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fh-filters select { width: auto; min-width: 200px; }

/* Abas (sites) e filtros em chips */
.fh-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.fh-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line, #26364e); background: var(--panel, #131d2d); color: var(--muted, #93a4ba); font: inherit; font-weight: 600; cursor: pointer; }
.fh-tab span { font-size: .75rem; padding: 1px 7px; border-radius: 999px; background: var(--panel-soft, #17243a); color: var(--text, #f3f7fb); }
.fh-tab:hover { color: var(--text, #f3f7fb); }
.fh-tab.on { background: var(--blue, #54b6ff); border-color: var(--blue, #54b6ff); color: #07111f; }
.fh-tab.on span { background: rgba(7, 17, 31, .18); color: #07111f; }
.fh-tab:focus-visible { outline: 2px solid var(--blue, #54b6ff); outline-offset: 2px; }

/* Rodando hoje: um cartão por funil, uma linha por idioma */
.fh-group + .fh-group { margin-top: 20px; }
.fh-grouphead { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em !important; color: var(--muted, #93a4ba); margin: 0 0 10px !important; }
.fh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 14px; }
.fh-fcard { background: var(--panel, #131d2d); border: 1px solid var(--line, #26364e); border-radius: var(--fh-radius); padding: 14px 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.fh-fcard.fh-pending { border-style: dashed; border-color: var(--yellow, #ffcf70); }
.fh-fhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.fh-fhead h4 { font-size: 1rem; flex: 1 1 auto; min-width: 0; }
.fh-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; padding: 2px 8px; border-radius: 6px; background: var(--panel-soft, #17243a); color: var(--muted, #93a4ba); }
.fh-id-warn { color: var(--yellow, #ffcf70); }
.fh-plat { display: inline-flex; gap: 6px; font-size: .74rem; font-weight: 600; }
.fh-pm { color: var(--blue, #54b6ff); font-style: normal; }
.fh-pg { color: var(--yellow, #ffcf70); font-style: normal; }
.fh-plat span { padding: 2px 8px; border-radius: 999px; background: var(--panel-soft, #17243a); }
.fh-lrows { display: grid; gap: 4px; }
.fh-lrow, .fh-urow { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; background: var(--panel-soft, #17243a); }
.fh-lang { font-size: .72rem; font-weight: 700; text-align: center; padding: 3px 0; border-radius: 6px; background: rgba(84, 182, 255, .14); color: var(--blue, #54b6ff); }
.fh-lmid { min-width: 0; }
.fh-url { display: block; min-width: 0; overflow-wrap: anywhere; font-size: .86rem; }
.fh-nolink { color: var(--muted, #93a4ba); }
.fh-cnt { font-size: .8rem; color: var(--muted, #93a4ba); white-space: nowrap; }
.fh-cnt b { color: var(--text, #f3f7fb); font-size: .95rem; }
.fh-copy { font: inherit; font-size: .72rem; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line, #26364e); background: transparent; color: var(--muted, #93a4ba); cursor: pointer; }
.fh-copy:hover { color: var(--text, #f3f7fb); border-color: var(--blue, #54b6ff); }
.fh-ffoot { font-size: .75rem; color: var(--muted, #93a4ba); }

/* Fichas */
.fh-list { display: grid; gap: 10px; }
.fh-card { background: var(--panel, #131d2d); border: 1px solid var(--line, #26364e); border-radius: var(--fh-radius); }
.fh-card > summary { cursor: pointer; list-style: none; padding: 14px 16px; display: grid; gap: 6px; }
.fh-card > summary::-webkit-details-marker { display: none; }
.fh-card > summary::after { content: "⌄"; position: absolute; right: 16px; color: var(--muted, #93a4ba); }
.fh-card { position: relative; }
.fh-card[open] > summary::after { content: "⌃"; }
.fh-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-right: 24px; }
.fh-title strong { font-size: 1rem; }
.fh-meta { color: var(--muted, #93a4ba); font-size: .82rem; }
.fh-body { padding: 0 16px 16px; display: grid; gap: 16px; min-width: 0; }
.fh-block h5 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em !important; color: var(--muted, #93a4ba); margin-bottom: 8px !important; }
.fh-urows { display: grid; gap: 4px; }
.fh-urow { grid-template-columns: 36px minmax(0, 1.4fr) minmax(0, 1.6fr) auto; }
.fh-nums { font-size: .8rem; color: var(--muted, #93a4ba); }
.fh-fields { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 6px 16px; margin: 0; }
.fh-fields dt { color: var(--muted, #93a4ba); }
.fh-fields dd { margin: 0; overflow-wrap: anywhere; }
.fh-ads { margin: 0; padding-left: 18px; }
.fh-label { font-weight: 600; margin: 10px 0 4px; font-size: .82rem; }

/* Chips de status */
.fh-chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .74rem; font-weight: 600; white-space: nowrap; border: 1px solid currentColor; background: transparent; }
.fh-class-sucesso, .fh-fit-sim { color: var(--green, #55d69a); }
.fh-class-sem-sucesso, .fh-fit-nao { color: var(--red, #ff7777); }
.fh-class-inconclusivo, .fh-class-amostra-insuficiente, .fh-fit-talvez { color: var(--yellow, #ffcf70); }
.fh-class-sem-teste, .fh-class-sem-dado-de-roi, .fh-fit-sem-dado, .fh-line-evergreen, .fh-line-biblia, .fh-line-beneficios, .fh-line-cursos { color: var(--muted, #93a4ba); }
.fh-stage-teste { color: var(--blue, #54b6ff); }
.fh-stage-pesquisa { color: #b9a0ff; }

/* Pesquisa: cartões */
.fh-rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.fh-rcard { background: var(--panel, #131d2d); border: 1px solid var(--line, #26364e); border-radius: var(--fh-radius); padding: 14px 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.fh-rhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fh-rhead h4 { font-size: 1rem; }
.fh-rwho { margin: 0; color: var(--muted, #93a4ba); font-size: .84rem; overflow-wrap: anywhere; }
.fh-rfacts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: .82rem; }
.fh-rfacts dt { color: var(--muted, #93a4ba); }
.fh-rfacts dd { margin: 0; overflow-wrap: anywhere; }
.fh-rwhy { margin: 0; font-size: .84rem; padding-top: 8px; border-top: 1px solid var(--line, #26364e); }
.fh-rlink { margin: 0; font-size: .82rem; }
.fh-lim { margin-top: 12px; color: var(--muted, #93a4ba); font-size: .82rem; }
.fh-lim summary { cursor: pointer; }

/* Critério */
.fh-criterion { background: var(--panel, #131d2d); border: 1px solid var(--line, #26364e); border-radius: var(--fh-radius); padding: 12px 16px; }
.fh-criterion > summary { cursor: pointer; font-weight: 600; }
.fh-criterion[open] > summary { margin-bottom: 8px; }
.fh-criterion ul { margin: 0 0 8px; padding-left: 18px; }

@media (max-width: 640px) {
  .fh-stat { flex-basis: 45%; }
  .fh-lrow { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .fh-lrow .fh-copy { display: none; }
  .fh-urow { grid-template-columns: 34px minmax(0, 1fr); }
  .fh-urow .fh-nums, .fh-urow .fh-chip { grid-column: 2; justify-self: start; }
  .fh-fields { grid-template-columns: 1fr; gap: 2px; }
  .fh-fields dd { margin-bottom: 8px; }
  .fh-filters select { width: 100%; }
}

/* Números por URL vindos do banco dos funis (7 dias, 30 dias, desde o início). */
.fh-urow { grid-template-columns: 36px minmax(0, 1.2fr) minmax(0, 1.8fr) auto; }
.fh-perf { display: grid; gap: 2px; font-size: .8rem; color: var(--text, #f3f7fb); min-width: 0; }
.fh-win i { font-style: normal; color: var(--muted, #93a4ba); display: inline-block; min-width: 92px; }
.fh-lrow { grid-template-columns: 36px minmax(0, 1fr) auto auto; }
.fh-lwin { grid-column: 2 / -1; font-size: .76rem; color: var(--muted, #93a4ba); }
.fh-chip[title] { cursor: help; }
@media (max-width: 640px) {
  .fh-lrow { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .fh-urow { grid-template-columns: 34px minmax(0, 1fr); }
  .fh-urow .fh-perf { grid-column: 2; }
  .fh-win i { min-width: 70px; }
  .fh-lwin { grid-column: 2 / -1; }
}
