/* O app Jurídico: os Contratos (a lista e o contrato aberto numa folha de papel), os Modelos e os Dados.
   Materiais do sistema (cosmos.css) e controles da casa (campos.css). O papel é claro nos dois temas, como num editor de texto. */

.janela.j-juridico:not(.cheia) { max-width: 1320px; }
.jr {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; container-type: inline-size;
  --jr-neutro: #3a404b; --jr-verde: #3ecf8e; --jr-vermelho: #ff8a7a; --jr-mesa: rgba(0, 0, 0, .26); --jr-linha: rgba(255, 255, 255, .07);
  /* a folha por cima do app é sólida: nada do que está atrás aparece através dela, e o véu não precisa de desfoque (vidro dentro de vidro) */
  --jr-folha: #1f2530;
}
:root[data-tema="claro"] .jr { --jr-neutro: #e1e4e9; --jr-verde: #12805f; --jr-vermelho: #c4382a; --jr-mesa: rgba(0, 0, 0, .07); --jr-linha: rgba(0, 0, 0, .07); --jr-folha: #fbfbfc; }
.jr > * { min-width: 0; }

/* ---------------------------------------------------------------- o topo: as áreas e a ação da área */
.jr-topo { flex: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px 10px; }
.jr[data-aberto="doc"] .jr-topo, .jr[data-aberto="modelo"] .jr-topo { display: none; }
.jr-areas button { min-width: 92px; }
.jr-novo .ico { margin-left: -3px; }
.jr-velho { flex: none; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 12px; font-weight: 600; line-height: 22px; color: #16181d; background: #facc15; white-space: nowrap; cursor: default; }

/* ---------------------------------------------------------------- a área */
.jr-area { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0 10px 10px; border-radius: 8px; background: var(--poco); overflow: hidden; }
.jr[data-aberto="doc"] .jr-area, .jr[data-aberto="modelo"] .jr-area { margin: 0; border-radius: 0; background: none; }
.jr-rolo { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.jr-estado { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px 16px; font-size: 14.5px; text-align: center; color: var(--tinta-2); }
.jr-estado p { max-width: 46ch; }
.jr-vazio { margin: 0; padding: 14px 6px; font-size: 13.5px; color: var(--tinta-3); }
.jr-fantasma { display: block; width: min(560px, 80%); height: 64px; border-radius: 8px; background: rgba(var(--f), .06); animation: jr-pulso 1.6s ease-in-out infinite; }
.jr-fantasma-papel { width: min(620px, 86%); height: 70%; border-radius: 4px; }
@keyframes jr-pulso { 50% { opacity: .45; } }

/* os selos: fundo sólido, letra escura; os neutros na cor da superfície */
.jr-selo { flex: none; display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 5px; font-style: normal; font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap; color: #16181d; background: var(--cor, #a3a3a3); }
.jr-selo.neutro { color: var(--tinta); background: var(--jr-neutro); }
.jr-ava { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: #fff; background: var(--cor, #6b7688); }
.jr-ava-vertech { background: var(--laranja); }

/* ---------------------------------------------------------------- Contratos: a lista */
.jr-lista-area { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.jr-barra { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 14px 16px 10px; }
.jr-barra-fim { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.jr-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.jr-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 32px; padding: 0 11px; border-radius: 7px; font-size: 13.5px; font-weight: 500; color: var(--tinta-2); background: rgba(var(--f), .07); transition: background-color .14s ease, color .14s ease; }
.jr-chip i { flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--cor); }
.jr-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-chip small { flex: none; font-size: 12.5px; color: var(--tinta-3); }
.jr-chip.on { color: var(--tinta); background: rgba(var(--f), .17); }
.jr-chip.on small { color: var(--tinta-2); }
.jr .jr-filtro { width: auto; min-width: 104px; max-width: 200px; height: 32px; font-size: 13.5px; color: var(--tinta-2); }
.jr-filtro.ligado { color: var(--tinta); background: rgba(var(--f), .14); }
.jr-busca { display: flex; align-items: center; gap: 8px; width: 210px; height: 32px; padding: 0 10px; border-radius: 6px; color: var(--tinta-3); background: rgba(var(--f), .075); cursor: text; transition: background-color .16s ease, box-shadow .16s ease; }
.jr-busca:focus-within { background: rgba(var(--f), .11); box-shadow: inset 0 0 0 1px rgba(var(--f), .22); }
.jr-busca input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; font-size: 14px; color: var(--tinta); background: none; }
.jr-busca input::placeholder { color: var(--tinta-3); opacity: 1; }
.jr-busca input::-webkit-search-cancel-button { display: none; }
.jr-busca input:focus-visible { box-shadow: none; }
.jr-lista { padding: 2px 12px 16px 16px; }
.jr-linhas { display: flex; flex-direction: column; gap: 4px; max-width: 1240px; }
.jr-linha { display: grid; grid-template-columns: 30px minmax(0, 1fr) 96px 112px minmax(0, 190px) 74px; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 7px 10px; border-radius: 7px; text-align: left; color: var(--tinta); cursor: pointer; transition: background-color .14s ease; }
.jr-linha.apagada .jr-l-txt { opacity: .6; }
.jr-folhinha { display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 26px; height: 32px; padding: 0 5px; border-radius: 3px; background: #f3f4f6; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.jr-folhinha i { display: block; height: 2px; border-radius: 1px; background: #b5bbc4; }
.jr-folhinha i:first-child { width: 70%; background: #4a5263; }
.jr-folhinha i:last-child { width: 60%; }
.jr-l-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.jr-l-txt > b { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-l-sub { font-size: 12.5px; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-l-tipo, .jr-l-estado { display: flex; }
.jr-l-falta { min-width: 0; font-size: 13px; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-l-falta.bom { color: var(--jr-verde); }
.jr-l-dia { font-size: 12.5px; text-align: right; color: var(--tinta-3); white-space: nowrap; }

/* ---------------------------------------------------------------- Modelos */
.jr-modelos { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; padding: 18px 16px 20px 18px; max-width: 1400px; }
.jr-modelo { display: flex; flex-direction: column; min-width: 0; border-radius: 9px; text-align: left; color: var(--tinta); background: rgba(var(--f), .05); overflow: hidden; cursor: pointer; transition: background-color .14s ease; }
.jr-mini { display: block; height: 150px; padding: 16px 22px 0; background: var(--jr-mesa); overflow: hidden; }
.jr-mini-papel { display: block; height: 100%; padding: 14px 14px 0; border-radius: 3px 3px 0 0; font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; font-size: 8.5px; line-height: 1.5; text-align: justify; color: #4b5260; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); overflow: hidden; transition: transform .2s var(--ease-out); }
.jr-mini-papel b { display: block; margin-bottom: 6px; font-size: 9.5px; text-align: center; color: #1f2328; }
.jr-modelo-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 14px 14px; }
.jr-modelo-txt > b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-modelo-txt > small { font-size: 12.5px; line-height: 1.4; color: var(--tinta-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jr-modelo-pe { margin-top: 3px; font-size: 12px; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- Dados */
.jr-dados { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: var(--jr-dados, 290px) minmax(0, 1fr); }
.jr-dados > * { min-height: 0; min-width: 0; }
.jr-dados-lado { display: flex; flex-direction: column; gap: 4px; padding: 14px 8px 12px 10px; overflow-y: auto; overscroll-behavior: contain; box-shadow: 1px 0 0 var(--jr-linha); }
.jr-dados-lado h3, .jr-sec h3 { margin: 12px 8px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--tinta-3); }
.jr-quem { flex: none; display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 7px; text-align: left; color: var(--tinta); cursor: pointer; transition: background-color .14s ease; }
.jr-quem.on { background: rgba(var(--f), .12); }
.jr-quem-txt { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 8px; }
.jr-quem-txt b { min-width: 0; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-quem-txt small { font-size: 12px; color: var(--tinta-3); }
.jr-barrinha { grid-column: 1 / -1; display: block; height: 4px; border-radius: 2px; background: rgba(var(--f), .1); overflow: hidden; }
.jr-barrinha i { display: block; width: var(--p); height: 100%; border-radius: 2px; background: var(--jr-verde); }
.jr-dados-meio { overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 14px 22px 22px; }
.jr-dados-cab { display: flex; align-items: center; gap: 10px; min-height: 40px; margin-bottom: 10px; }
.jr-dados-cab h2 { min-width: 0; font-size: 20px; font-weight: 600; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-dados-quando { flex: none; font-size: 12.5px; color: var(--tinta-3); }
.jr-form-dados { max-width: 760px; }
.jr-dados-pe { display: flex; justify-content: flex-end; padding-top: 16px; }

/* os formulários: os campos em duas colunas; os longos e o endereço de ponta a ponta */
.jr-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.jr-campo-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jr-campo-f.largo { grid-column: 1 / -1; }
.jr-campo-f > span { font-size: 12.5px; font-weight: 500; color: var(--tinta-3); }
.jr-campo-f input, .jr-campo-f textarea { width: 100%; min-width: 0; height: 36px; padding: 0 10px; border: 0; border-radius: 6px; outline: 0; font: inherit; font-size: 14.5px; color: var(--tinta); background: rgba(var(--f), .075); transition: background-color .16s ease, box-shadow .16s ease; }
.jr-campo-f textarea { height: auto; min-height: 76px; padding: 8px 10px; line-height: 1.45; resize: vertical; }
.jr-campo-f input:focus, .jr-campo-f textarea:focus { background: rgba(var(--f), .11); box-shadow: inset 0 0 0 1px rgba(var(--f), .26); }
.jr-campo-f input::placeholder { color: var(--tinta-3); opacity: 1; }
.jr-campo-f input:disabled { opacity: .6; }
.jr-campo-f .segmento { align-self: flex-start; }

/* ---------------------------------------------------------------- o contrato e o modelo abertos: a área toda do app */
.jr-doc { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.jr-doc-topo { flex: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px 10px; }
.jr-doc-titulo { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.jr-doc-titulo h2 { min-width: 0; font-size: 17px; font-weight: 600; letter-spacing: -.012em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-doc-sub { font-size: 12.5px; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-doc-estado { flex: none; display: flex; }
.jr-doc-topo .redondo, .jr-doc-topo .botao, .jr-dados-cab .redondo { flex: none; }
.jr-doc-topo .botao .ico { margin-left: -3px; }
.jr-abas { display: none; }
.jr-doc-corpo { --divisa-base: 10px; position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--jr-painel, 356px); gap: 10px; padding: 0 10px 10px; }
.jr-doc-corpo > * { min-height: 0; min-width: 0; }
.jr-doc-texto { display: flex; flex-direction: column; border-radius: 8px; background: var(--jr-mesa); overflow: hidden; }
.jr-painel { display: flex; flex-direction: column; gap: 6px; padding: 6px 14px 18px; border-radius: 8px; background: var(--poco); overflow-y: auto; overscroll-behavior: contain; }

/* o editor: a barra mínima e a folha de papel, clara nos dois temas */
.jr-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.jr-ferramentas { flex: none; display: flex; align-items: center; gap: 2px; min-height: 44px; padding: 6px 10px; box-shadow: 0 1px 0 var(--jr-linha); }
.jr-ferramentas[hidden] { display: none; }
.jr-ferr { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: var(--tinta-2); cursor: pointer; transition: background-color .14s ease, color .14s ease, transform .12s var(--ease-out); }
.jr-ferr:active { transform: scale(.94); }
.jr-ferr.on { color: var(--tinta); background: rgba(var(--f), .16); }
.jr-sep { display: block; width: 1px; height: 18px; margin: 0 6px; background: rgba(var(--f), .14); }
.jr-guardado { min-width: 0; font-size: 12.5px; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-guardado.erro { color: var(--jr-vermelho); }
.jr-mesa { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable both-edges; padding: 26px 20px 48px; }
.jr-papel {
  width: min(100%, 780px); min-height: 1000px; margin: 0 auto; padding: 68px 76px 84px; border-radius: 3px; outline: none;
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; font-size: 15.5px; line-height: 1.62; color: #1f2328;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .22), 0 14px 34px -16px rgba(0, 0, 0, .5);
  user-select: text; -webkit-user-select: text; overflow-wrap: anywhere; hyphens: auto; caret-color: var(--laranja); cursor: text;
}
.jr-editor.so-ler .jr-papel { cursor: default; }
.jr-papel::selection, .jr-papel *::selection { background: rgba(var(--laranja-rgb), .26); }
.jr-papel h1 { margin: 0 0 26px; font-size: 20px; font-weight: 700; letter-spacing: .03em; line-height: 1.35; text-align: center; }
.jr-papel h2 { margin: 26px 0 10px; font-size: 16px; font-weight: 700; line-height: 1.4; }
.jr-papel h3, .jr-papel h4 { margin: 20px 0 8px; font-size: 15.5px; font-weight: 700; }
.jr-papel p { margin: 0 0 12px; }
.jr-papel ul, .jr-papel ol { margin: 0 0 12px; padding-left: 26px; }
.jr-papel li { margin-bottom: 4px; }
.jr-papel blockquote { margin: 0 0 12px; padding-left: 14px; color: #4b5260; box-shadow: inset 2px 0 0 #d5d9df; }
.jr-papel hr { height: 1px; margin: 20px 0; border: 0; background: #d5d9df; }
.jr-papel a { color: #b5460a; }
/* o campo ainda sem valor: uma etiqueta com o nome do dado (clicar seleciona; digitar põe o valor no lugar) */
.jr-campo { display: inline; padding: 1px 5px; border-radius: 4px; font-family: var(--fonte), system-ui, sans-serif; font-size: .82em; font-weight: 600; font-style: normal; color: #7a4100; background: #ffe7c7; -webkit-box-decoration-break: clone; box-decoration-break: clone; hyphens: manual; cursor: pointer; }
.jr-editor.so-ler .jr-campo { cursor: default; }

/* o painel do contrato */
.jr-sec { display: flex; flex-direction: column; gap: 8px; padding: 10px 2px 12px; }
.jr-sec + .jr-sec { box-shadow: 0 -1px 0 var(--jr-linha); }
.jr-sec h3 { display: flex; align-items: center; gap: 8px; margin: 2px 0 2px; }
.jr-sec h3 small { font-size: 11.5px; letter-spacing: 0; color: var(--tinta-2); }
.jr-sec h4 { margin: 8px 0 2px; font-size: 12.5px; font-weight: 600; color: var(--tinta-2); }
.jr-sec-estado { gap: 12px; padding-top: 12px; }
.jr-estado-linha { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; font-weight: 600; }
.jr-trilho { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 2px 0 0; padding: 0; list-style: none; }
.jr-trilho li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; text-align: center; }
.jr-trilho li::before { content: ""; position: absolute; top: 5px; right: 50%; width: 100%; height: 2px; background: rgba(var(--f), .14); }
.jr-trilho li:first-child::before { display: none; }
.jr-trilho li.passou::before, .jr-trilho li.atual::before { background: var(--laranja); }
.jr-trilho li i { position: relative; z-index: 1; display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--jr-neutro); }
.jr-trilho li.passou i { background: var(--laranja); }
.jr-trilho li.atual i { background: var(--laranja); box-shadow: 0 0 0 3px rgba(var(--laranja-rgb), .28); }
.jr-trilho li span { max-width: 100%; font-size: 11.5px; font-weight: 500; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-trilho li.passou span, .jr-trilho li.atual span { color: var(--tinta); }
.jr-trilho li small { min-height: 15px; font-size: 11px; color: var(--tinta-3); white-space: nowrap; }
.jr-trilho.cancelado { opacity: .5; }
.jr-passo, .jr-acompanhar { width: 100%; height: 38px; }
.jr-passo .ico, .jr-acompanhar .ico { margin-left: -3px; }
.jr-faltam { display: flex; flex-wrap: wrap; gap: 6px; }
.jr-falta { display: inline-flex; align-items: center; max-width: 100%; min-height: 30px; padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; text-align: left; color: #6b3800; background: #ffe2bd; cursor: pointer; transition: background-color .14s ease, transform .12s var(--ease-out); }
.jr-falta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-falta:active { transform: scale(.97); }
.jr-texto-bt { display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; height: 30px; padding: 0 8px; margin-left: -8px; border-radius: 6px; font-size: 13.5px; font-weight: 500; color: var(--laranja-claro); cursor: pointer; transition: background-color .14s ease; }
.jr-texto-bt:disabled { opacity: .5; cursor: default; }
.jr-sigs { display: flex; flex-direction: column; gap: 4px; }
.jr-sig { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; width: calc(100% + 16px); padding: 8px; margin: 0 -8px; border-radius: 7px; text-align: left; color: var(--tinta); }
button.jr-sig { cursor: pointer; transition: background-color .14s ease; }
.jr-sig-txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.jr-sig-txt b { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-sig-txt small { font-size: 12.5px; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-sig-txt small.ruim { color: var(--jr-vermelho); }
.jr-sig-fim { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.jr-sig-andou { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--tinta-2); white-space: nowrap; }
.jr-sig-andou.bom { color: var(--jr-verde); }
.jr-sig-acao { grid-column: 2 / -1; justify-self: start; }
.jr-acoes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.jr-acoes .botao { width: 100%; min-width: 0; }
.jr-acoes .botao .ico { margin-left: -3px; }
.jr-acoes .botao span { overflow: hidden; text-overflow: ellipsis; }
.jr-eventos { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.jr-eventos li { display: flex; flex-direction: column; gap: 1px; font-size: 13px; line-height: 1.4; color: var(--tinta-2); }
.jr-eventos time { font-size: 11.5px; color: var(--tinta-3); }
.jr-eventos b { font-weight: 600; color: var(--tinta); }
/* o painel do modelo: o nome, a descrição e os campos para pôr no texto */
.jr-form-modelo { gap: 12px; padding-top: 12px; }
.jr-campos { display: flex; flex-wrap: wrap; gap: 5px; }
.jr-campo-bt { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 28px; padding: 3px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 500; text-align: left; color: var(--tinta-2); background: rgba(var(--f), .07); cursor: pointer; transition: background-color .14s ease, color .14s ease; }
.jr-campo-bt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-campo-bt.usado { color: #6b3800; background: #ffe2bd; }
.jr-campo-bt .ico { flex: none; }
.jr-campo-bt:disabled { opacity: .55; cursor: default; }

/* ---------------------------------------------------------------- as folhas */
.jr-veu { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: var(--veu); animation: jr-veu .16s ease; }
.jr-veu[hidden] { display: none; }
@keyframes jr-veu { from { opacity: 0; } }
.jr-folha { display: flex; flex-direction: column; width: min(520px, 100%); max-height: 100%; border-radius: 10px; color: var(--tinta); background: var(--jr-folha); box-shadow: var(--brilho), 0 30px 70px -24px rgba(0, 0, 0, .8); overflow: hidden; outline: none; animation: jr-folha .18s ease-out; }
.jr-folha-larga { width: min(660px, 100%); }
@keyframes jr-folha { from { opacity: 0; } }
.jr-folha.sem-entrada { animation: none; }
.jr-folha > header { flex: none; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 10px 0 18px; font-size: 16px; font-weight: 600; }
.jr-folha > header span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-folha > header .redondo { flex: none; width: 30px; height: 30px; border-radius: 7px; }
.jr-folha-corpo { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 4px 18px 8px; overflow-y: auto; overscroll-behavior: contain; }
.jr-folha > footer { flex: none; display: flex; align-items: center; gap: 8px; padding: 14px 18px 16px; }
.jr-folha > footer .botao .ico { margin-left: -3px; }
.jr-folha-erro { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--erro); }
.jr-dupla { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.jr-folha-resumo { display: flex; align-items: baseline; gap: 12px; padding: 11px 12px; border-radius: 8px; font-size: 14px; background: rgba(var(--f), .06); }
.jr-folha-resumo > b { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-folha-resumo > span { flex: none; font-size: 13px; color: var(--tinta-3); }
.jr-envia { display: flex; flex-direction: column; gap: 4px; }
.jr-envia-linha { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 2px; }
.jr-escolhas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.jr-escolha { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 78px; padding: 10px 34px 10px 12px; border-radius: 8px; text-align: left; color: var(--tinta); background: rgba(var(--f), .06); cursor: pointer; transition: background-color .14s ease; }
.jr-escolha b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-escolha small { font-size: 12px; line-height: 1.4; color: var(--tinta-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jr-escolha .ico { position: absolute; top: 10px; right: 10px; color: var(--laranja-claro); }
.jr-escolha.on { background: rgba(var(--f), .15); }
.jr-escolha.on b { color: var(--tinta); }
.jr-visor { width: min(1040px, 100%); height: min(820px, 100%); }
.jr-visor > header a.redondo { flex: none; width: 30px; height: 30px; border-radius: 7px; }
.jr-visor-palco { flex: 1; min-height: 0; display: grid; place-items: center; margin: 0 12px 12px; border-radius: 8px; background: var(--poco); overflow: hidden; }
.jr-visor-palco iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.jr-visor-palco .jr-fantasma { width: 60%; height: 60%; }

/* o atalho na ficha do cliente, no Projetos */
.pj-ver-juridico { margin-top: 12px; }

/* ---------------------------------------------------------------- toda área clicável responde por inteiro */
@media (hover: hover) and (pointer: fine) {
  .jr-linha:hover, button.jr-sig:hover, .jr-quem:not(.on):hover { background: rgba(var(--f), .06); }
  .jr-chip:not(.on):hover { color: var(--tinta); background: rgba(var(--f), .12); }
  .jr-modelo:hover { background: rgba(var(--f), .09); }
  .jr-modelo:hover .jr-mini-papel { transform: translateY(-3px); }
  .jr-ferr:not(.on):hover, .jr-texto-bt:not(:disabled):hover { background: rgba(var(--f), .1); color: var(--tinta); }
  .jr-texto-bt:not(:disabled):hover { color: var(--laranja-claro); }
  .jr-falta:hover, .jr-campo-bt.usado:not(:disabled):hover { background: #ffd39c; }
  .jr-campo-bt:not(.usado):not(:disabled):hover { color: var(--tinta); background: rgba(var(--f), .13); }
  .jr-escolha:not(.on):hover { background: rgba(var(--f), .1); }
  .jr-papel .jr-campo:hover { background: #ffd39c; }
}
.jr :is(.jr-linha, .jr-chip, .jr-modelo, .jr-quem, button.jr-sig, .jr-falta, .jr-texto-bt, .jr-campo-bt, .jr-escolha, .jr-ferr):focus-visible { outline: none; box-shadow: 0 0 0 1.5px rgba(var(--f), .5); }
.jr :is(.jr-linha, .jr-chip, .jr-modelo, .jr-quem, button.jr-sig, .jr-falta, .jr-texto-bt, .jr-campo-bt, .jr-escolha, .jr-ferr, .jr-abas button) { cursor: pointer; }
.jr .redondo { justify-content: center; }

/* ---------------------------------------------------------------- telas médias: o painel do contrato fica mais estreito */
@container (max-width: 1080px) {
  .jr-doc-corpo { grid-template-columns: minmax(0, 1fr) var(--jr-painel, 316px); }
  .jr-papel { padding: 52px 52px 68px; }
  .jr-linha { grid-template-columns: 30px minmax(0, 1fr) 96px 112px 74px; }
  .jr-l-falta { display: none; }
}

/* ---------------------------------------------------------------- celular: um app, nada rola para o lado */
@media (max-width: 860px) {
  .jr-topo { gap: 8px; padding: 0 8px 8px; }
  .jr-topo > .espaco, .jr-velho { display: none; }
  .jr-areas { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .jr-areas button { min-width: 0; padding: 0 4px; font-size: 14px; }
  .jr-novo { flex: none; width: 40px; padding: 0; }
  .jr-novo span { display: none; }
  .jr-novo .ico { margin: 0; }
  .jr-area { margin: 0 8px calc(8px + env(safe-area-inset-bottom)); }
  /* a lista: os estados numa fileira que desliza com o dedo; o tipo e a busca embaixo */
  .jr-barra { gap: 8px; padding: 12px 10px 8px; }
  .jr-chips { flex-wrap: nowrap; width: calc(100% + 20px); margin: 0 -10px; padding: 0 10px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .jr-chips::-webkit-scrollbar { display: none; }
  .jr-chip { flex: none; height: 36px; }
  .jr-barra-fim { width: 100%; margin: 0; }
  .jr .jr-filtro { flex: none; width: auto; min-width: 0; height: 40px; font-size: 15px; }
  .jr-busca { flex: 1; width: auto; height: 40px; }
  .jr-busca input { font-size: 16px; }
  .jr-lista { padding: 2px 6px 14px; scrollbar-gutter: auto; }
  .jr-linha { grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "folha txt dia" "folha selos selos"; gap: 6px 10px; min-height: 70px; padding: 10px 8px; }
  .jr-folhinha { grid-area: folha; align-self: start; margin-top: 2px; width: 24px; height: 30px; }
  .jr-l-txt { grid-area: txt; }
  .jr-l-txt > b { font-size: 15.5px; }
  .jr-l-dia { grid-area: dia; align-self: start; padding-top: 2px; }
  .jr-l-tipo { display: none; }
  .jr-l-estado { grid-area: selos; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .jr-l-falta { display: none; }
  /* os modelos, um por linha */
  .jr-modelos { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 10px 16px; }
  .jr-mini { height: 116px; }
  /* os dados: a lista e, ao tocar, a ficha na tela toda */
  .jr-dados { grid-template-columns: minmax(0, 1fr); }
  .jr-dados[data-vista="lista"] .jr-dados-meio, .jr-dados[data-vista="ficha"] .jr-dados-lado { display: none; }
  .jr-dados-lado { padding: 10px 6px 14px; box-shadow: none; }
  .jr-quem { min-height: 52px; padding: 10px 10px; }
  .jr-quem-txt b { font-size: 15.5px; }
  .jr-dados-meio { padding: 10px 12px 18px; scrollbar-gutter: auto; }
  .jr-dados-cab h2 { flex: 1; font-size: 18px; }
  .jr-dados-cab .espaco, .jr-dados-quando { display: none; }
  .jr-form { grid-template-columns: minmax(0, 1fr); }
  .jr-campo-f input { height: 42px; font-size: 16px; }
  .jr-campo-f textarea { font-size: 16px; }
  .jr-dados-pe .botao { flex: 1; }
  /* o contrato e o modelo: a tela toda, com o texto e os detalhes em duas abas */
  .jr-doc-topo { gap: 8px; min-height: 48px; padding: 0 8px 8px; }
  .jr-doc-titulo h2 { font-size: 16px; }
  .jr-doc-topo .jr-velho, .jr-ver-pdf { display: none; }
  .jr-gerar { width: 40px; padding: 0; }
  .jr-gerar span { display: none; }
  .jr-gerar .ico { margin: 0 !important; }
  .jr-abas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: none; margin: 0 8px 8px; }
  .jr-abas button { min-width: 0; }
  .jr-doc-corpo { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 0 env(safe-area-inset-bottom); }
  .jr-doc[data-aba="texto"] .jr-painel, .jr-doc[data-aba="painel"] .jr-doc-texto { display: none; }
  .jr-doc-texto, .jr-painel { border-radius: 0; }
  .jr-painel { padding: 4px 14px 22px; }
  .jr-ferramentas { gap: 4px; min-height: 52px; padding: 6px 8px; }
  .jr-ferr { width: 40px; height: 40px; }
  .jr-mesa { padding: 12px 10px 28px; scrollbar-gutter: auto; }
  .jr-papel { min-height: 0; padding: 28px 22px 40px; font-size: 16px; line-height: 1.6; }
  .jr-papel h1 { font-size: 18.5px; margin-bottom: 20px; }
  /* na tela estreita, o texto justificado abre buracos entre as palavras: aqui ele fica alinhado à esquerda (o arquivo não muda) */
  .jr-papel p, .jr-papel li { text-align: left !important; }
  .jr-falta { min-height: 38px; font-size: 14px; }
  .jr-texto-bt { height: 40px; font-size: 15px; }
  .jr-sig { min-height: 56px; }
  .jr-sig-acao { min-width: 120px; }
  .jr-campo-bt { min-height: 38px; font-size: 14px; padding: 4px 11px; }
  .jr-acoes { grid-template-columns: minmax(0, 1fr); }
  .jr-passo, .jr-acompanhar { height: 44px; font-size: 15px; }
  .jr-trilho li span { font-size: 11px; }
  /* as folhas na tela toda */
  .jr-veu { padding: 0; }
  .jr-folha, .jr-folha-larga, .jr-visor { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .jr-folha > header .redondo, .jr-visor > header a.redondo { width: 40px; height: 40px; }
  .jr-folha > footer { flex-wrap: wrap; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .jr-folha > footer .botao { flex: 1; }
  .jr-folha > footer .espaco { display: none; }
  .jr-dupla, .jr-escolhas { grid-template-columns: minmax(0, 1fr); }
  .jr-seg-tipo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .jr-escolha { min-height: 64px; }
  .jr-visor-palco { margin: 0; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .jr-veu, .jr-folha, .jr-fantasma { animation: none; } .jr-mini-papel { transition: none; } }
