/* CORTEX Leis — componentes próprios sobre o casco da MDZ Folha (ZYNIX + padrao-visual-global.css).
   Cores só pelos tokens --pv-* e --selo-* da Folha, que já valem nos dois temas (data-theme-mode).
   Contraste conferido por capturas.py (mínimo 4,5:1). */

.pular { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 8px 14px; border-radius: 8px;
  background: var(--pv-btn-primario); color: #fff; font-weight: 600; text-decoration: none; }
.pular:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--pv-accent); outline-offset: 2px; }

/* marca em texto no lugar da logo (como a Folha sem logo cadastrada) */
.marca-texto { gap: 10px; text-decoration: none; min-width: 0; }
.marca-sigla { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--pv-btn-primario); color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.3px; }
.marca-nome { display: flex; flex-direction: column; color: var(--pv-text); font-weight: 700; font-size: 17px; line-height: 1.2; white-space: nowrap; }
.marca-nome b { color: var(--pv-accent); font-weight: 700; }
.marca-nome small { color: var(--pv-muted); font-weight: 500; font-size: 11.5px; }

/* título da página: subtítulo e campos do lado direito */
.page-header-breadcrumb .breadcrumb { font-size: 12.5px; }
.page-header-breadcrumb .breadcrumb a { color: var(--pv-accent-ink); text-decoration: none; }
.page-header-breadcrumb .breadcrumb-item.active { color: var(--pv-muted); }
.cabecalho-texto { max-width: 80ch; }
.cabecalho-texto p { color: var(--pv-muted); }
.custom-card + .custom-card { margin-top: 0; }
.sub-titulo { font-size: 11.5px; color: var(--pv-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.meta { font-size: 12.5px; color: var(--pv-muted); }
.meta a { white-space: nowrap; }
.aviso-fonte { font-size: 12.5px; color: var(--pv-muted); }
a { color: var(--pv-accent); }
.pergunta-campo { font-size: 15px; padding: .65rem .9rem; }
details > summary { cursor: pointer; color: var(--pv-accent); font-weight: 600; font-size: 13px; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 28px; margin: 0 4px 6px 0; font-size: 12px; font-weight: 600;
  background: var(--pv-surface-2); color: var(--pv-text); text-decoration: none; border: 1px solid var(--pv-border); }
a.chip:hover { border-color: var(--pv-accent); color: var(--pv-accent-ink); }
a.chip[aria-current] { background: var(--pv-accent-weak); color: var(--pv-accent-ink); border-color: var(--pv-accent); }
.badge.mini { font-size: 10px; padding: 2px 7px; }

/* texto de lei: medida e corpo de documento */
.texto-lei, .resposta, .diff { font-size: 15px; line-height: 1.7; font-weight: 500; color: var(--pv-text); max-width: 78ch; }
.resposta { white-space: pre-wrap; }
.resposta .ref { font-weight: 700; color: var(--pv-accent); text-decoration: none; }

/* resultados da pergunta */
.resultado { border-top: 1px solid var(--pv-border); padding: 16px 0; }
.resultado:first-of-type { border-top: 0; padding-top: 4px; }
.resultado h3 { font-size: 15px; font-weight: 700; margin: 0; }
.resultado .num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 6px; margin-right: 8px;
  background: var(--pv-accent-weak); color: var(--pv-accent-ink); font-size: 12px; font-weight: 700; }
.resultado .texto { margin: .5rem 0 .25rem; }
.resultado .contexto { color: var(--pv-muted); font-size: 13.5px; line-height: 1.6; border-left: 3px solid var(--pv-border-strong); padding-left: 12px; margin-top: 8px; max-width: 78ch; }
.nota-vig { border-left: 3px solid var(--pv-warn); background: var(--selo-aviso-bg); color: var(--pv-text); padding: 8px 12px; border-radius: 6px;
  font-size: 13.5px; margin-top: 8px; max-width: 78ch; }

/* norma: árvore + painel */
.grade-norma { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.card.painel-fixo { position: sticky !important; top: calc(var(--shell-header-h, 74px) + 16px); max-height: calc(100vh - var(--shell-header-h, 74px) - 32px); overflow: auto; }
.arvore .card-body { padding: 24px 32px; }
.arvore .estr { font-size: 12px; font-weight: 700; color: var(--pv-muted); text-transform: uppercase; letter-spacing: .05em; margin: 22px 0 8px; max-width: 78ch; }
.arvore .disp { padding: 3px 10px; border-radius: 6px; font-size: 15px; line-height: 1.7; scroll-margin-top: calc(var(--shell-header-h, 74px) + 24px); max-width: 78ch; }
.arvore .disp:target, .arvore .disp.sel { background: var(--pv-accent-weak); box-shadow: inset 3px 0 0 var(--pv-accent); }
.arvore .disp .rot { font-weight: 700; margin-right: 4px; color: var(--pv-text); text-decoration: none; }
.arvore .disp .rot:hover { color: var(--pv-accent); text-decoration: underline; }
.arvore .disp.revogado .txt { color: var(--pv-muted); font-style: italic; }
.arvore .t-artigo { margin-top: 12px; }
.arvore .t-paragrafo { margin-left: 1.5rem; } .arvore .t-inciso { margin-left: 3rem; }
.arvore .t-alinea { margin-left: 4.5rem; } .arvore .t-item { margin-left: 6rem; }

/* linha do tempo */
.linha-tempo { list-style: none; padding: 0; margin: 0; position: relative; }
.linha-tempo::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--pv-border-strong); }
.linha-tempo li { position: relative; padding: 0 0 16px 30px; }
.linha-tempo li::before { content: ""; position: absolute; left: 3px; top: 5px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--pv-surface); border: 3px solid var(--pv-muted); }
.linha-tempo li.atual::before { border-color: var(--pv-ok); }
.linha-tempo li.na-data::before { background: var(--pv-accent); border-color: var(--pv-accent); }
.linha-tempo li.rev::before { border-color: var(--pv-crit); }
.linha-tempo .quando { font-weight: 700; font-size: 13.5px; }
.linha-tempo .txt { font-size: 14px; line-height: 1.6; margin-top: 2px; }

/* comparar */
.diff del { background: var(--selo-erro-bg); color: var(--selo-erro-fg); text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.diff ins { background: var(--selo-sucesso-bg); color: var(--selo-sucesso-fg); text-decoration: none; border-radius: 3px; padding: 0 2px; }
.lado { border: 1px solid var(--pv-border); border-radius: 8px; padding: 14px 16px; height: 100%; background: var(--pv-surface-2); }
.lado .texto-lei { font-size: 14.5px; }

/* acervo e avaliação */
.metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.metricas .custom-card { margin-bottom: 0; }
.metrica .valor { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--pv-text); }
.metrica .rot { font-size: 12.5px; color: var(--pv-muted); }
.ok { color: var(--selo-sucesso-fg); } .falha { color: var(--selo-erro-fg); }
pre.codigo { background: var(--pv-surface-2); color: var(--pv-text); border: 1px solid var(--pv-border); border-radius: 8px; padding: 12px 14px;
  font-size: 12.5px; white-space: pre-wrap; font-family: var(--pv-mono); }
code, pre.codigo { font-family: var(--pv-mono) !important; }
code { color: var(--pv-accent-ink); font-size: .92em; }

@media (max-width: 1280px) { .grade-norma { grid-template-columns: 1fr; } .card.painel-fixo { position: static !important; max-height: none; } }
@media (max-width: 991.98px) { .arvore .card-body { padding: 16px; } }

/* Ajustes de contraste sobre o padrão da Folha: o rótulo de campo usa --pv-faint (3,1:1 no claro, 3,9:1 no escuro);
   aqui vai para --pv-muted. Link sobre o fundo da página (fora do cartão) usa o tom de texto do acento. */
html[data-theme-mode] .form-label, html[data-theme-mode] .col-form-label { color: var(--pv-muted) !important; }
.page-header-breadcrumb a, .main-content > .container-fluid > nav a { color: var(--pv-accent-ink); }

/* Pergunte: selo do modo, campo com o botão, exemplos e resumo do acervo */
.badge.selo-modo { font-size: 12px; line-height: 16px; padding: 4px 10px; display: inline-flex; align-items: center; }
.btn-buscar { flex: none; min-width: 120px; }
.card-header h2.card-title { font-size: inherit; }
.exemplos { display: flex; flex-wrap: wrap; gap: 8px; }
.exemplo { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 28px; font-size: 13px; font-weight: 600;
  background: var(--pv-accent-weak); color: var(--pv-accent-ink); text-decoration: none; border: 1px solid transparent; }
.exemplo:hover, .exemplo:focus-visible { border-color: var(--pv-accent); color: var(--pv-accent-ink); }
.resumo-acervo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.resumo-acervo > div { display: flex; flex-direction: column; }
.resumo-acervo .valor { font-size: 22px; font-weight: 700; line-height: 1.15; color: var(--pv-text); }
.resumo-acervo .rot { font-size: 12px; color: var(--pv-muted); }
.pergunta-campo::placeholder { color: var(--pv-muted); opacity: 1; }
.painel-fixo h2.card-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }

/* resposta redigida: citação que não está entre os dispositivos recuperados */
.ref-invalida { color: var(--selo-revogado-texto, #9a2a12); text-decoration: underline wavy; cursor: help; }
/* telas sem sessão (_auth.html): cartão centralizado como o login da MDZ Folha, sem header nem menu */
body.pagina-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #133039 0%, #466C77 100%) !important; }
html[data-theme-mode="dark"] body.pagina-auth { background: linear-gradient(135deg, #070b11 0%, #1a2a35 100%) !important; }
.auth-tema { position: fixed; top: 16px; right: 16px; }
.auth-cartao { width: 100%; max-width: 460px; background: var(--pv-surface); border-radius: 12px; overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, .3), 0 10px 25px rgba(0, 0, 0, .15); }
.auth-topo { background: var(--pv-surface-2); border-bottom: 1px solid var(--pv-border); padding: 32px 40px 24px; text-align: center; }
.auth-marca { display: inline-flex; align-items: center; margin-bottom: 18px; text-align: left; }
.auth-titulo { font-size: 18px; font-weight: 700; letter-spacing: -.2px; margin: 0; color: var(--pv-text); }
.auth-lema { font-size: 12.5px; color: var(--pv-muted); margin: 6px 0 0; }
.auth-lema:empty { display: none; }
.auth-corpo { padding: 32px 40px; }
.auth-corpo .form-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--pv-muted); margin-bottom: 4px; }
.auth-corpo .form-control { border-radius: 8px; padding: 11px 12px; }
.auth-botao { padding: 12px; font-size: 14px; font-weight: 600; border-radius: 8px; }
.auth-rodape { background: var(--pv-surface-2); border-top: 1px solid var(--pv-border); padding: 14px 40px; text-align: center; }
@media (max-width: 480px) { .auth-topo, .auth-corpo, .auth-rodape { padding-left: 22px; padding-right: 22px; } }
.chave-nova { font-family: ui-monospace, monospace; word-break: break-all; user-select: all; }
.prompt-campo { font-family: ui-monospace, monospace; font-size: .85rem; }
