/* Custo de IA (#/ia) e o modo TV. Só tokens do tema; o amarelo fica no detalhe, como no manual de ID. */
.ia { display: flex; flex-direction: column; gap: 16px; }
.ia-heroi .kpis { margin-top: 18px; grid-template-columns: minmax(280px, 1.6fr) repeat(3, minmax(150px, 1fr)); }
@media (max-width: 1100px) { .ia-heroi .kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.ia-heroi .kpi .n { white-space: nowrap; }
.ia-heroi__total .n { font-size: clamp(30px, 3.6vw, 50px); }
.ia-heroi__nota { margin-top: 18px; font-size: calc(12px * var(--fs, 1)); }
.ia-grafico { margin-top: 14px; }
.grafico-barras--baixo { height: 170px; }
.ia-legenda { display: inline-flex; align-items: center; gap: 6px; font: 400 calc(11px * var(--fs, 1)) var(--dados); color: var(--tinta-2); }
.ia-legenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.ia-cor-openai { background: var(--tinta); }
.ia-cor-anthropic { background: var(--tinta-3); }
.ia-eixo { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; }
.ia-cartao-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ia-barras { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.ia-barras li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 9.5em; align-items: center; gap: 10px; padding: 3px 4px; border-radius: 6px; }
.ia-barras li.clicavel { cursor: pointer; }
.ia-barras li.clicavel:hover, .ia-barras li.clicavel:focus-visible { background: var(--linha-suave); }
.ia-barras__nome { font-size: calc(13.5px * var(--fs, 1)); }
.ia-barras__trilho { height: 8px; border-radius: 99px; background: var(--linha-suave); overflow: hidden; }
.ia-barras__trilho i { display: block; height: 100%; border-radius: inherit; background: var(--tinta); transform-origin: left; animation: ia-cresce .7s var(--ease) both; }
.ia-barras__valor { font-family: var(--dados); font-size: calc(12.5px * var(--fs, 1)); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ia-barras__valor small { margin-left: 6px; opacity: .6; }
.ia-erro { color: var(--erro); }
.ia-falhas li { align-items: flex-start; }
.ia-falhas p { margin-top: 2px; font-size: calc(12.5px * var(--fs, 1)); overflow-wrap: anywhere; }
@keyframes ia-cresce { from { transform: scaleX(0); } }

/* Modo TV */
.ia-modo-tv body { overflow: hidden; }
.ia-tv { position: fixed; inset: 0; z-index: 2147483000; color-scheme: dark; background: var(--preto); color: var(--papel); display: grid; place-items: center; padding: 6vh 7vw; }
.ia-tv::after { content: ''; position: absolute; inset: 40% -10% -40% 30%; background: radial-gradient(closest-side, rgba(255, 236, 170, .10), transparent); animation: ia-respira 4s ease-in-out infinite; pointer-events: none; }
.ia-tv__sair { position: absolute; top: 18px; right: 22px; z-index: 1; background: transparent; color: rgba(241, 239, 232, .55); border: 1px solid rgba(241, 239, 232, .2); border-radius: 99px; padding: 6px 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.ia-tv__cena { width: min(1200px, 100%); position: relative; z-index: 1; }
.ia-tv__cena--entra { animation: ia-foco .7s var(--ease) both; }
.ia-tv .rotulo { color: rgba(241, 239, 232, .6); font-size: clamp(14px, 1.4vw, 20px); }
.ia-tv .rotulo::before { content: '✱ '; color: var(--amarelo); }
.ia-tv__numero { font-family: var(--display); font-size: clamp(64px, 11vw, 180px); line-height: 1; letter-spacing: -.04em; margin-top: 2vh; font-variant-numeric: tabular-nums; }
.ia-tv__sub { font-size: clamp(16px, 1.8vw, 26px); color: rgba(241, 239, 232, .7); margin-top: 1.5vh; }
.ia-tv__grafico { margin-top: 5vh; }
.ia-tv__grafico .barras span { background: rgba(241, 239, 232, .55); }
.ia-tv__grafico .barras span.atual { background: var(--papel); }
.ia-tv .ia-barras { gap: 2.2vh; margin-top: 4vh; }
.ia-tv .ia-barras__nome, .ia-tv .ia-barras__valor { font-size: clamp(16px, 1.8vw, 28px); }
.ia-tv .ia-barras__trilho { height: 14px; background: rgba(241, 239, 232, .1); }
.ia-tv .ia-barras__trilho i { background: var(--papel); }
.ia-tv__lista { list-style: none; padding: 0; margin: 4vh 0 0; display: grid; gap: 2vh; }
.ia-tv__lista li { display: flex; justify-content: space-between; gap: 24px; font-size: clamp(18px, 2vw, 32px); border-bottom: 1px solid rgba(241, 239, 232, .1); padding-bottom: 1.4vh; }
.ia-tv__lista small { opacity: .55; font-size: .7em; margin-left: 8px; }
.ia-tv__lista b { font-family: var(--dados); font-weight: 400; }
.ia-tv__pontos { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.ia-tv__pontos i { width: 8px; height: 8px; border-radius: 50%; background: rgba(241, 239, 232, .25); }
.ia-tv__pontos i.ativo { background: var(--amarelo); }
@keyframes ia-foco { from { opacity: 0; filter: blur(12px); } }
@keyframes ia-respira { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .ia-tv::after, .ia-tv__cena--entra, .ia-barras__trilho i { animation: none; } }

/* Listas longas abrem recolhidas; "Ver todos" mostra o resto */
.ia-recolhe[data-recolhe="8"]:not(.ia-recolhe--aberto):not(.ia-buscando) tbody tr:nth-child(n+9),
.ia-recolhe[data-recolhe="10"]:not(.ia-recolhe--aberto):not(.ia-buscando) tbody tr:nth-child(n+11),
.ia-recolhe[data-recolhe="5"]:not(.ia-recolhe--aberto) .ia-falhas li:nth-child(n+6) { display: none; }
.ia-falhas .corta { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ia-falhas li > div { min-width: 0; flex: 1; }
.ia-sem-fluxo { margin-top: 12px; }
.ia-sem-fluxo summary { cursor: pointer; }
.ia-modelo { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ia-modelo .rotulo { margin-top: 6px; }

/* Filtros: chip do cliente, busca nas tabelas, ações do estado vazio */
.ia-chip { gap: 6px; }
.ia-busca { min-width: 0; width: min(260px, 45%); margin-left: auto; }
.ia-busca input { padding-top: 5px; padding-bottom: 5px; }
.ia-cli-link { cursor: pointer; text-decoration: underline; text-decoration-color: var(--linha); text-underline-offset: 3px; border-radius: 4px; }
.ia-cli-link:hover, .ia-cli-link:focus-visible { text-decoration-color: currentColor; background: var(--linha-suave); }
.ia-vazio-acoes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* Celular: barras mais estreitas, busca em linha própria e tabelas sem colunas secundárias */
.modo-movel .ia-barras li { grid-template-columns: minmax(70px, 38%) 1fr 7.5em; gap: 6px; }
.modo-movel .ia-cartao-topo { flex-wrap: wrap; }
.modo-movel .ia-busca { width: 100%; order: 3; }
.modo-movel #ia-por-fluxo th:nth-child(4), .modo-movel #ia-por-fluxo td:nth-child(4),
.modo-movel #ia-por-fluxo th:nth-child(8), .modo-movel #ia-por-fluxo td:nth-child(8) { display: none; }
.ia-estimativa { margin: 6px 0 10px; padding: 8px 12px; border-left: 3px solid var(--amarelo); background: var(--linha-suave); border-radius: 8px; font-size: calc(12.5px * var(--fs, 1)); color: var(--tinta-2); }
