.widget-mercados {
  box-sizing: border-box;
  width: 100%;
  max-width: 340px;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  color: #111111;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

.widget-mercados * {
  box-sizing: border-box;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.widget-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.widget-icone {
  font-size: 15px;
}

/* Mesmo padrão visual (ícone + linha degradê) usado nos títulos de seção do
   jornal.html — repetido aqui pra não depender do Tailwind estar carregado
   em toda página que inclua este widget. */
.widget-divisor {
  height: 2px;
  background: linear-gradient(to right, #7a5c00, #FFD700 45%, #ffe9a8);
  margin-bottom: 12px;
}

.widget-lista {
  display: flex;
  flex-direction: column;
}

.widget-carregando,
.widget-erro {
  padding: 20px 4px;
  color: #8a8a8a;
  font-size: 13px;
  text-align: center;
}

.linha-mercado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.linha-mercado:last-child {
  border-bottom: none;
}

.mercado-info {
  min-width: 0;
}

.mercado-nome {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mercado-ticker {
  font-size: 12px;
  color: #8a8a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.mercado-direita {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mercado-sparkline {
  width: 46px;
  height: 22px;
  display: block;
}

.mercado-valores {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 68px;
}

.mercado-variacao {
  font-size: 13px;
  font-weight: 700;
}

.mercado-preco {
  font-size: 12px;
  color: #8a8a8a;
}

.subindo {
  color: #16a34a;
}

.caindo {
  color: #dc2626;
}

/* ==================== MODO ESCURO ====================
   Reaproveita as variáveis de public/jornal/theme.css (carregado antes
   deste arquivo em jornal.html/categoria.html, únicas páginas que incluem
   este widget). .subindo/.caindo (verde/vermelho) não mudam de propósito —
   pedido explícito de manter esse comportamento como já está; só o fundo e
   os textos neutros escurecem. */
html.dark .widget-mercados {
  background: var(--nopic-surface, #1e1e1e);
  color: #f0f0f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

html.dark .widget-titulo {
  color: #FFD700;
}

html.dark .widget-carregando,
html.dark .widget-erro {
  color: #9ca3af;
}

html.dark .linha-mercado {
  border-bottom-color: var(--nopic-border, #2a2a2a);
}

html.dark .mercado-nome {
  color: #f5f5f5;
}

html.dark .mercado-ticker,
html.dark .mercado-preco {
  color: #9ca3af;
}
