:root {
  --bg: #0a0f1c;
  --bg-elevated: #0f1524;
  --sidebar-bg: #0b1120;
  --card-bg: #121a2b;
  --card-border: #1e293b;
  --text-primary: #e6eaf2;
  --text-headline: #f7f9fc;
  --text-secondary: #8b96ab;
  --text-nav: #b7c0d1;
  --text-muted: #5b6478;
  --text-disabled: #707c93;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);
  --yellow: #eab308;
  --yellow-soft: rgba(234, 179, 8, 0.12);
  --orange: #f97316;
  --orange-soft: rgba(249, 115, 22, 0.12);
  --gray: #64748b;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--card-border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
}

.logo-icon { font-size: 22px; color: var(--accent); }
.logo-text strong { display: block; font-size: 14px; letter-spacing: 0.5px; }
.logo-text small { color: var(--text-secondary); font-size: 11px; }
.accent { color: var(--accent); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-nav);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}
.nav-item:hover:not(.disabled):not(.active) { background: rgba(255, 255, 255, 0.04); color: var(--text-primary); }

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
}
.nav-item.disabled .nav-icon { opacity: 0.6; }

.disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
}

/* Main */

main { flex: 1; padding: 20px 28px 40px; min-width: 0; max-width: 1680px; margin: 0 auto; width: 100%; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.brand strong { font-size: 20px; letter-spacing: 0.5px; }
.brand small { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 2px; }

.topbar-info { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.auth-widget { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.auth-saudacao { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.auth-widget .btn-secundario { padding: 4px 10px; font-size: 11px; }

.datetime-block { text-align: right; }
.datetime-value { font-variant-numeric: tabular-nums; font-size: 14px; }
.datetime-label { color: var(--text-secondary); font-size: 11px; }

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 12px;
  color: var(--text-secondary);
}

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gray);
  flex-shrink: 0;
}
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.indisponivel { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.dot.experimental { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); }
.dot.nao_implementado { background: var(--gray); }
.dot.nao_consultado { background: var(--gray); }
.dot.fallback { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); }
.dot.ultimo_valido { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); }
/* Reservado: nenhum provider emite esses status ainda (nao inventado no
   frontend), mas o estilo ja existe pra quando existirem (seção 15). */
.dot.atrasado { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); }
.dot.mercado_fechado { background: var(--gray); }

.btn-refresh {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-refresh:hover { filter: brightness(1.1); }
.btn-refresh:disabled { opacity: 0.6; cursor: default; }

.btn-secundario {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secundario:hover { border-color: var(--accent); color: var(--accent); }
.btn-secundario:disabled { opacity: 0.6; cursor: default; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card-bg);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Blocks */

.block { margin-bottom: 28px; }

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.block-header h2 { font-size: 15px; margin: 0; font-weight: 700; color: var(--text-headline); }
/* SVG no lugar do emoji de bandeira (🇧🇷) - Windows renderiza esse emoji
   específico como as letras "BR" em vez da bandeira de verdade (limitação
   de fonte do sistema, não do navegador) - pedido do Leandro, 29/09/2026. */
.flag-br { width: 20px; height: 14px; vertical-align: -2px; border-radius: 2px; }
.block-ref { color: var(--text-muted); font-size: 12px; }
.block-header-right { display: flex; align-items: center; gap: 12px; }

.btn-ver-mais {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}
.btn-ver-mais:hover { text-decoration: underline; }

/* Listas compactas (Notícias, Agenda, Status das fontes) - uma linha por
   item, "Ver todas/completa/detalhes" no cabeçalho expande o resto em vez
   de mostrar tudo de uma vez (pedido do Leandro, 29/09/2026). */
.lista-compacta { display: flex; flex-direction: column; }
.lista-compacta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--card-border);
  font-size: 12px;
}
.lista-compacta-item:last-child { border-bottom: none; }
.lista-compacta-meta {
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  width: 72px;
}
.lista-compacta-titulo {
  flex: 1;
  min-width: 0;
  color: var(--text-headline);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.lista-compacta-titulo:hover { color: var(--accent); text-decoration: underline; }
.lista-compacta-extra { flex-shrink: 0; color: var(--text-secondary); font-size: 11px; white-space: nowrap; }

/* Notícias/Agenda/Status lado a lado, cada um num painel menor (referência
   visual do Leandro, 29/09/2026) - antes eram 3 blocos cheios empilhados. */
.listas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}
.bloco-compacto {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 0;
}
.bloco-compacto .block-header { margin-bottom: 6px; }
.bloco-compacto .block-header h2 { font-size: 13px; }
.bloco-compacto .lista-compacta-item { font-size: 11px; padding: 6px 0; gap: 6px; }
.bloco-compacto .lista-compacta-meta { width: 42px; }
.bloco-compacto .noticia-badge { font-size: 9px; padding: 2px 7px; }
@media (max-width: 860px) {
  .listas-grid { grid-template-columns: 1fr; }
}

.cards-grid {
  display: grid;
  /* auto-fit (não auto-fill): colunas sem card pra preencher somem em vez
     de ficar reservadas como espaço vazio - achado real do Leandro
     (29/09/2026): em telas largas, a fileira de 6 cards do Exterior/
     Madrugada deixava uma coluna extra em branco à direita porque
     auto-fill sempre reserva o espaço, mesmo sem conteúdo pra ocupar. */
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

/* Brasil + Curva DI lado a lado, evita vao vazio em telas largas */
.brasil-di-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 1180px) {
  .brasil-di-grid { grid-template-columns: 1fr; }
}
.brasil-col .cards-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* Tabela e gráfico da Curva DI lado a lado, mais compactos (referência
   visual do Leandro, 29/09/2026) - antes ficavam empilhados, ocupando
   bem mais altura que o necessário. */
.di-content-row { display: flex; gap: 10px; align-items: stretch; }
.di-content-row .di-table-wrap { flex: 1 1 52%; min-width: 0; }
.di-content-row .di-chart-wrap { flex: 1 1 48%; min-width: 0; margin-top: 0; }
.di-col .di-table th, .di-col .di-table td { padding: 6px 8px; font-size: 11px; }
.di-col .di-chart { height: 118px; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-symbol-group { display: flex; align-items: center; gap: 6px; }
.card-symbol { font-size: 12px; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.4px; }

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  font-size: 10px;
  cursor: help;
  line-height: 1;
}
.info-icon:hover { border-color: var(--accent); color: var(--accent); }

/* Tooltip flutuante única, compartilhada por todo [data-tooltip] do site -
   position:fixed calculado via JS (utils.js), não CSS ::after puro. Achado
   do Leandro (29/09/2026): um ::after posicionado com `position:absolute`
   dentro de um contêiner com overflow-x:auto (o carrossel do Radar) ficava
   cortado, porque o CSS não permite ter overflow-x:auto sem o navegador
   forçar overflow-y:auto também no mesmo elemento - ou seja, não tem como
   deixar só o eixo horizontal "cortando" e o vertical livre pro tooltip
   vazar pra cima. position:fixed escapa desse corte porque não depende do
   overflow de nenhum ancestral. */
.tooltip-flutuante {
  position: fixed;
  background: #1a2233;
  color: var(--text-primary);
  padding: 9px 11px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  max-width: 220px;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  z-index: 200;
}
.tooltip-flutuante.ativo { opacity: 1; visibility: visible; }

.card-price { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; color: var(--text-headline); }
.card-price.indisponivel { color: var(--text-muted); font-size: 14px; font-weight: 500; }

.card-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: fit-content;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
}
.card-change.up { color: var(--green); background: var(--green-soft); }
.card-change.down { color: var(--red); background: var(--red-soft); }
.card-change.flat { color: var(--text-secondary); background: rgba(255, 255, 255, 0.05); }

.card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--card-border);
}
.card-meta .label-extra { display: block; color: var(--yellow); margin-top: 2px; }

/* Curva suave + área com degradê + ponto final destacado - opção "D" entre
   4 estilos que o Leandro escolheu comparando um mockup (29/09/2026). Usa
   currentColor pra herdar a cor de .sparkline.up/.down/.flat tanto na linha
   quanto no degradê e no ponto, sem duplicar as 3 cores em 3 regras. */
.sparkline { width: 100%; height: 26px; display: block; overflow: visible; }
.sparkline-linha {
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.sparkline-ponto { fill: currentColor; }
.sparkline.up { color: var(--green); }
.sparkline.down { color: var(--red); }
.sparkline.flat { color: var(--text-secondary); }

/* Skeleton de carregamento (primeiro load) */

.skeleton {
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: skeleton-sweep 1.4s infinite;
}
@keyframes skeleton-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* DI table */

.di-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  /* sem overflow:hidden de proposito - clipava o tooltip das linhas (as
     canto-arredondados ficam levemente menos perfeitos, troca aceitavel) */
}
.di-table th, .di-table td {
  text-align: left;
  padding: 10px 16px;
  font-size: 13px;
}
.di-table tbody td:first-child { font-weight: 500; }
.di-table tbody tr[data-tooltip] { cursor: help; }
.di-table th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--card-border);
}
.di-table tr:not(:last-child) td { border-bottom: 1px solid var(--card-border); }
.di-table td.up { color: var(--green); }
.di-table td.down { color: var(--red); }

.di-chart-wrap { margin-top: 14px; }
.di-chart {
  width: 100%;
  height: 130px;
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}
.di-line { fill: none; stroke-width: 2; }
.di-line.hoje { stroke: var(--accent); }
.di-line.ontem { stroke: var(--text-muted); stroke-dasharray: 4 3; }
.di-point.hoje { fill: var(--accent); }
.di-chart-label { fill: var(--text-muted); font-size: 8px; }
.di-axis-label { fill: var(--text-muted); font-size: 7.5px; }
.di-chart-empty { color: var(--text-muted); font-size: 12px; padding: 14px; text-align: center; }

/* Resumo Brasil — faixa compacta abaixo dos cards, preenche o vao que
   sobrava enquanto a Curva DI (mais alta, por causa do grafico) ocupava
   mais altura que a fileira de cards do Brasil. */
.resumo-brasil-wrap {
  margin-top: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.resumo-brasil-wrap h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  font-weight: 700;
  margin: 0 0 8px;
}
.resumo-brasil { display: flex; flex-direction: column; }
.resumo-linha {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--card-border);
}
.resumo-linha:last-child { border-bottom: none; }
.resumo-linha .resumo-symbol { width: 64px; font-weight: 600; color: var(--text-headline); flex-shrink: 0; }
.resumo-linha .resumo-valor { flex: 1; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.resumo-linha .resumo-var { width: 82px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.resumo-linha .resumo-var.up { color: var(--green); }
.resumo-linha .resumo-var.down { color: var(--red); }
.resumo-linha .resumo-var.flat { color: var(--text-secondary); }

.di-chart-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 11px; color: var(--text-secondary); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 2.5px; border-radius: 2px; display: inline-block; }
.legend-dot.hoje { background: var(--accent); }
.legend-dot.ontem { background: var(--text-muted); }

/* Madrugada — comparacao em cards (lado esquerdo) + leitura em painel
   proprio (lado direito), igual referencia visual do Leandro. */

.madrugada-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1180px) {
  .madrugada-layout { grid-template-columns: 1fr; }
}

.madrugada-indisponivel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text-secondary);
  font-size: 13px;
  grid-column: 1 / -1;
}

.card-transicao {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.card-transicao .seta-transicao { color: var(--text-muted); margin: 0 4px; }

.leitura-box {
  background: linear-gradient(135deg, var(--accent-soft), rgba(59, 130, 246, 0.03));
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
}
.leitura-box .leitura-titulo {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  margin-bottom: 6px;
}
/* Texto da leitura tem tamanho padrão (não cresce com o tamanho do texto do
   dia) pra não "puxar" a fileira de cards ao lado pra baixo, deixando um
   vão vazio embaixo delas - pedido do Leandro, 29/09/2026. "Ver detalhes"
   só aparece quando o texto realmente não coube nas 3 linhas padrão. */
.leitura-box .leitura-texto {
  max-height: 72px;
  overflow: hidden;
}
.leitura-box.expandido .leitura-texto { max-height: none; }
.leitura-toggle {
  display: block;
  margin-top: 8px;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.leitura-toggle:hover { text-decoration: underline; }
.leitura-toggle[hidden] { display: none; }

/* Radar de Confirmacao — vetores (esquerda) + leitura (direita) */

.radar-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1180px) {
  .radar-layout { grid-template-columns: 1fr; }
}

/* Vetores do Radar em carrossel horizontal (setas pros lados) em vez de
   quebrar em 2ª linha quando não cabem todos (pedido do Leandro,
   29/09/2026 - com 9 vetores, 2 linhas ficava desalinhado com a leitura). */
.radar-carrossel {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.radar-grid {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.radar-grid::-webkit-scrollbar { display: none; }

.radar-seta {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.radar-seta:hover { border-color: var(--accent); color: var(--accent); }

.radar-tile {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 92px;
  flex: 0 0 150px;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.radar-tile:hover { transform: translateY(-2px); border-color: rgba(59, 130, 246, 0.5); }
.radar-tile .radar-label { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.radar-tile .radar-estado {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.radar-tile .radar-variacao { margin-top: 3px; font-size: 10px; color: var(--text-muted); }
.radar-tile .radar-descricao {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-secondary);
}

.radar-estado.confirma, .radar-estado.sustentacao { color: var(--green); }
.radar-estado.diverge, .radar-estado.pressao { color: var(--red); }
.radar-estado.neutro { color: var(--gray); }
.radar-estado.contexto { color: var(--accent); }
.radar-estado.inconclusivo { color: var(--yellow); }

/* Status das fontes — compacto, em chips (seção reduzida de propósito;
   futuramente divide em Notícias / Agenda / Status próprios) */

.status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: help;
}
.status-row .fonte-nome { font-weight: 500; }
.status-row .fonte-status { color: var(--text-secondary); }

/* Histórico — lista de snapshots, linhas cheias (nao chip compacto, precisa
   caber data + resumo do WIN + contagem do radar). */
#historico-lista { display: flex; flex-direction: column; gap: 8px; }
.historico-item {
  border-radius: var(--radius) !important;
  padding: 12px 16px !important;
  justify-content: space-between;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.historico-item:hover { border-color: var(--accent); transform: translateX(2px); }
.historico-item .fonte-nome { font-weight: 600; color: var(--text-headline); }
.historico-item .fonte-status { flex: 1; text-align: right; }

/* Noticias relevantes */

#noticias-lista { display: flex; flex-direction: column; gap: 8px; }

.noticia-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--gray);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.noticia-item.pode_alterar_tese { border-left-color: var(--red); }
.noticia-item.importante { border-left-color: var(--orange); }
.noticia-item.contexto { border-left-color: var(--yellow); }
.noticia-item.ruido { border-left-color: var(--gray); }
.noticia-item.alta { border-left-color: var(--orange); }
.noticia-item.media { border-left-color: var(--yellow); }
.noticia-item.baixa { border-left-color: var(--gray); }

.noticia-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.noticia-titulo { font-size: 13px; font-weight: 600; color: var(--text-headline); }
.noticia-titulo a { color: inherit; text-decoration: none; }
.noticia-titulo a:hover { color: var(--accent); text-decoration: underline; }

.noticia-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.noticia-badge.pode_alterar_tese { color: var(--red); background: var(--red-soft); }
.noticia-badge.importante { color: var(--orange); background: var(--orange-soft); }
.noticia-badge.contexto { color: var(--yellow); background: var(--yellow-soft); }
.noticia-badge.ruido { color: var(--text-secondary); background: rgba(255, 255, 255, 0.05); }
.noticia-badge.alta { color: var(--orange); background: var(--orange-soft); }
.noticia-badge.media { color: var(--yellow); background: var(--yellow-soft); }
.noticia-badge.baixa { color: var(--text-secondary); background: rgba(255, 255, 255, 0.05); }

.noticia-meta { font-size: 11px; color: var(--text-muted); }

.video-player-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.video-player-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.form-analise-ia {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}
.form-analise-ia input[type="file"] {
  color: var(--text-secondary);
  font-size: 13px;
}
.form-analise-ia textarea,
.form-analise-ia input[type="password"] {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--text-headline);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 12px;
  resize: vertical;
}
.form-analise-ia button {
  align-self: flex-start;
}

.analise-ia-item { gap: 10px; }
.analise-ia-imagem {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}
.analise-ia-comentario {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: pre-wrap;
}
.btn-excluir-analise {
  font-size: 11px;
  padding: 4px 10px;
}

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; align-items: center; }
  .logo { border: none; padding: 0; margin: 0; }
  .disclaimer { display: none; }
  .nav { flex-direction: row; }
  .nav-item { white-space: nowrap; }
  main { padding: 16px; }
  .brasil-di-grid { grid-template-columns: 1fr; }
  .di-content-row { flex-direction: column; }
  .di-content-row .di-chart-wrap { margin-top: 10px; }
}
