/* ============ LECTNEX — estilos compartilhados ============ */
.term-panel { background: #fff; border: 1px solid #CBD5E1; box-shadow: 0 1px 2px rgba(12, 26, 42, .03); }
.dark .term-panel { background: #0B1626; border-color: #1E293B; box-shadow: none; }
.term-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #64748B; }
.quote-head { font-size: 10px; color: #55657A; background: #F1F5F9; font-weight: 700; }
.dark .quote-head { background: #060D17; }
.grid-bg { background-image: radial-gradient(rgba(100, 116, 139, .12) 1px, transparent 1px); background-size: 16px 16px; }

/* Selo de fonte do dado */
.src-tag { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .04em; text-transform: uppercase; color: #94A3B8; }

/* Selo para conteúdo simulado/didático — obrigatório em tudo que não for dado real */
.lx-demo { display: inline-flex; align-items: center; gap: 4px; font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; color: #B45309; background: rgba(245, 158, 11, .12); border: 1px dashed rgba(245, 158, 11, .55); }
.dark .lx-demo { color: #FBBF24; }

/* Painéis de cabeçalho escuro */
.panel-head { background: #0C1A2A; color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #1E293B; }

/* Inputs padrão */
.lx-input { width: 100%; padding: 8px 12px; background: #F8FAFC; border: 1px solid #CBD5E1; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 12px; }
.dark .lx-input { background: #060D17; border-color: #1E293B; color: #F1F5F9; }
.lx-input:focus { outline: none; border-color: #009988; }

/* Linhas de cotação */
.quote-row { display: grid; grid-template-columns: 1.4fr 1fr .8fr 1fr; padding: 9px 16px; border-bottom: 1px solid #E2E8F0; align-items: center; }
.dark .quote-row { border-color: #1E293B; }

@keyframes flashUp { 0% { background-color: rgba(16, 185, 129, .25); } 100% { background-color: transparent; } }
@keyframes flashDown { 0% { background-color: rgba(244, 63, 94, .25); } 100% { background-color: transparent; } }
.tick-up { animation: flashUp .9s ease-out; }
.tick-down { animation: flashDown .9s ease-out; }

.risk-scale { background: linear-gradient(90deg, #F43F5E 0%, #F39200 50%, #10B981 100%); position: relative; }
.risk-marker { position: absolute; top: -3px; width: 4px; height: 16px; background: #0C1A2A; border: 1px solid #fff; transition: left .3s ease; }
.dark .risk-marker { background: #fff; border-color: #0C1A2A; }

/* Barra de rolagem discreta */
.thin-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.thin-scroll::-webkit-scrollbar-thumb { background: #94A3B8; }

@media print { header, .no-print { display: none !important; } }

/* Carregamento elegante (skeleton) */
@keyframes lxShimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.lx-skel { color: transparent !important; display: inline-block; min-width: 4ch; border-radius: 2px;
    background: linear-gradient(90deg, rgba(148,163,184,.14) 25%, rgba(148,163,184,.32) 50%, rgba(148,163,184,.14) 75%); background-size: 200% 100%; animation: lxShimmer 1.4s ease-in-out infinite; }
.lx-skel-block { width: 100%; height: 100%; min-height: 46px;
    background: linear-gradient(90deg, rgba(148,163,184,.06) 25%, rgba(148,163,184,.16) 50%, rgba(148,163,184,.06) 75%); background-size: 200% 100%; animation: lxShimmer 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .lx-skel, .lx-skel-block { animation: none; } }

/* Faixa rolante (B3) — pausa ao passar o mouse; parada para quem prefere menos movimento */
@keyframes lxMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.lx-marquee { width: max-content; animation: lxMarquee 60s linear infinite; }
.lx-marquee:hover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .lx-marquee { animation: none; } #b3-tape { overflow-x: auto; } }

/* KPIs compactos do Mercado Hoje (o bloco "Agora" é o destaque) */
.lx-kpis > .term-panel { padding: .55rem .75rem; border-top-width: 2px; }
.lx-kpis strong.text-2xl { font-size: 1.05rem; line-height: 1.4rem; margin-top: .1rem; }
.lx-kpis .src-tag { display: none; }
.lx-kpis .term-label { font-size: 9px; }
.lx-kpis > .term-panel > span.text-\[11px\] { font-size: 10px; }
.lx-kpis > .term-panel > span:not(.term-label):not(.src-tag) { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Espaço reservado para o cabeçalho montado por JS: evita que a página "pule" ao carregar (CLS) */
#lx-topbar:empty { min-height: 37px; }
#lx-header:empty { min-height: 116px; margin-bottom: 26px; }
@media (min-width: 1024px) { #lx-header:empty { min-height: 73px; } }

/* ===== Contraste mínimo (WCAG AA, 4,5:1) — textos secundários e cores de variação nos dois temas ===== */
.lx-demo { color: #92400E; }
.dark .text-slate-500, .dark .text-\[\#64748B\] { color: #8A9BB1; }
.dark ::placeholder { color: #8A9BB1; }
html:not(.dark) .text-slate-500:not(footer, footer *, #lx-topbar *) { color: #55657A; }
html:not(.dark) .text-slate-400:not(footer, footer *, #lx-topbar *, .bg-lect-navy *) { color: #5F6E82; }
footer .text-slate-500 { color: #94A3B8; }
html:not(.dark) .text-lect-teal { color: #00756C; }
html:not(.dark) .text-lect-orange { color: #B45309; }
html:not(.dark) .text-emerald-500, html:not(.dark) .text-emerald-600 { color: #047857; }
html:not(.dark) .text-rose-500, html:not(.dark) .text-rose-600 { color: #BE123C; }
.dark .text-rose-600 { color: #FB7185; }
.dark .text-emerald-600 { color: #34D399; }

/* ===== Alto contraste (opção em "Personalizar") ===== */
.lx-hc body { -webkit-font-smoothing: auto; }
.lx-hc.dark .text-slate-500, .lx-hc.dark .text-slate-400, .lx-hc.dark .text-slate-300, .lx-hc.dark [class*="text-slate-"] { color: #E2E8F0 !important; }
.lx-hc:not(.dark) .text-slate-500, .lx-hc:not(.dark) .text-slate-400, .lx-hc:not(.dark) .text-slate-600 { color: #1E293B !important; }
.lx-hc .text-\[9px\], .lx-hc .text-\[10px\] { font-size: 11.5px !important; }
.lx-hc .text-\[11px\] { font-size: 12.5px !important; }
.lx-hc.dark .term-panel { border-color: #475569; }
.lx-hc:not(.dark) .term-panel { border-color: #64748B; }
.lx-hc .text-emerald-400, .lx-hc .text-emerald-500, .lx-hc .text-emerald-600 { font-weight: 700; }
.lx-hc .text-rose-400, .lx-hc .text-rose-500, .lx-hc .text-rose-600 { font-weight: 700; }

.dark .term-label { color: #8A9BB1; }
html:not(.dark) .term-label { color: #55657A; }
.lx-hc.dark .term-label { color: #E2E8F0; }
.lx-hc:not(.dark) .term-label { color: #1E293B; }
.dark .quote-head { color: #8A9BB1; }

/* Status dos dados no rodapé */
.lx-pulse { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); animation: lx-pulse 2.4s ease-out infinite; }
@keyframes lx-pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
@media (prefers-reduced-motion: reduce) { .lx-pulse { animation: none; } }
