/* Hallmark · genre: editorial with the v5 night · macrostructure: Workbench (the reading beside the document) · design-system: design.md · designed-as-app
 * Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V4 · contrast: pass (40-41) · tokens: pass (48) · mobile: pass (34, 49, 50-57)
 * "Veja a IA ler o seu documento": only this page's result. The page, the upload card, the progress, the examples and the
 * service band are in /site/capi/paginas/demos.css. Every text that comes from a document is written by the script as
 * text, never as markup. The reading: the document on the left (sticky on computers), the fields as ruled rows with the
 * state as a tag and the excerpt the AI read, the server's checks, what a person would check, and "Apagar agora". */

/* ---------- The header of a reading: the kind of document, the verdict, what it means, three numbers ---------- */
.resultado-cabeca { padding-bottom: var(--space-lg); border-bottom: 1px solid var(--color-rule); }
.resultado-tipo { color: var(--color-ink-2); font-size: var(--text-sm); font-weight: var(--wght-ui); line-height: 1.4; }
.resultado-cabeca h2 {
  max-width: 24ch;
  margin-top: var(--space-2xs);
  font-size: clamp(1.75rem, 1.15rem + 1.6vw, 3rem);
  font-weight: var(--wght-display);
  font-stretch: var(--wdth-display);
  letter-spacing: -0.025em;
  line-height: 1.02;
  text-wrap: balance;
}
.resultado-cabeca > p:not(.resultado-tipo) { max-width: 45ch; margin-top: var(--space-sm); color: var(--color-ink-2); }
.contadores { display: flex; flex-wrap: wrap; margin: var(--space-lg) 0 0; padding: 0; list-style: none; }
.contadores li {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  min-width: 7.5rem;
  padding: 0 var(--space-lg) 0 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: var(--wght-small);
  line-height: 1.3;
}
.contadores li + li { padding-left: var(--space-lg); border-left: 1px solid var(--color-rule); }
.contadores strong {
  color: var(--color-ink);
  font-size: clamp(2rem, 1.5rem + 1.4vw, 3rem);
  font-weight: var(--wght-display);
  font-stretch: var(--wdth-display);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.contadores li[data-tipo="duvida"] strong { color: var(--color-accent); }
@media (max-width: 39.99rem) {
  .contadores li { min-width: 0; flex: 1 1 0; padding-right: var(--space-sm); }
  .contadores li + li { padding-left: var(--space-sm); }
}
/* On computers the three numbers stand on the right, level with the end of the explanation */
@media (min-width: 64rem) {
  .resultado-cabeca { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--col-gap); }
  .resultado-cabeca > * { grid-column: 1; }
  .resultado-cabeca > .contadores { grid-column: 2; grid-row: 1 / span 3; align-self: end; justify-content: flex-end; margin-top: 0; }
  .contadores li:last-child { padding-right: 0; }
}

/* ---------- The document and the reading side by side from 901 px (where the script also puts a PDF beside it) ---------- */
.resultado-grade { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); margin-top: var(--space-lg); align-items: start; }
@media (min-width: 56.3125rem) {
  .resultado-grade { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-xl) clamp(var(--space-lg), 4vw, var(--space-3xl)); margin-top: var(--space-xl); }
  .previa { position: sticky; top: calc(var(--header-h) + var(--space-md)); }
}
.previa { min-width: 0; }
.previa-imagem { position: relative; display: block; overflow: hidden; border: 1px solid var(--color-rule); border-radius: var(--radius-media); background: var(--color-paper-2); }
.previa-imagem img { width: 100%; height: auto; max-height: 72vh; object-fit: contain; margin: 0 auto; }
.previa-pdf { display: block; width: 100%; height: min(72vh, 760px); border: 1px solid var(--color-rule); border-radius: var(--radius-media); background: var(--color-paper-2); }
.previa-ficha { display: grid; justify-items: start; gap: var(--space-md); padding: var(--space-md); border-radius: var(--radius-media); background: var(--color-paper-2); color: var(--color-ink-2); line-height: 1.5; }
.previa-ficha strong { display: block; margin-bottom: var(--space-3xs); color: var(--color-ink); font-weight: var(--wght-ui); }
.previa-legenda { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--space-md); margin-top: var(--space-2xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); line-height: 1.45; }
.previa-legenda span:empty { display: none; }
.previa-legenda a, .previa-legenda button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ink);
  font: inherit;
  font-weight: var(--wght-ui);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
  white-space: nowrap;
  cursor: pointer;
  transition: text-decoration-color var(--dur-color) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .previa-legenda a:hover, .previa-legenda button:hover { text-decoration-color: var(--color-accent); } }
/* On a phone a tall document is shown cut, with a button under it to open it whole */
@media (max-width: 56.25rem) {
  .previa[data-recolhida] .previa-imagem { max-height: 240px; }
  .previa[data-recolhida] .previa-imagem img { max-height: none; }
}

/* ---------- The reading: blocks under the same ink rule ---------- */
.resultado-leitura { min-width: 0; }
.bloco + .bloco { margin-top: var(--space-2xl); }
.bloco > h3 { font-size: var(--text-title); font-weight: var(--wght-ui); letter-spacing: var(--track-title); line-height: 1.2; text-wrap: balance; }
.bloco-nota { max-width: 50ch; margin-top: var(--space-2xs); color: var(--color-muted); font-size: 0.9375rem; font-weight: var(--wght-small); line-height: 1.5; }
.campos, .conferencias, .duvidas ul { margin: var(--space-md) 0 0; padding: 0; list-style: none; border-top: 2px solid var(--color-ink); }

/* A field: the label and its state, the value, the excerpt the AI read with the value marked, why it is in doubt */
.campo-lido { padding-block: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--color-rule); }
.campo-cabeca { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2xs) var(--space-sm); }
.campo-rotulo { color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); line-height: 1.4; }
.campo-estado { cursor: help; }
.campo-valor { margin-top: var(--space-3xs); font-size: 1.1875rem; font-weight: var(--wght-ui); line-height: 1.35; overflow-wrap: anywhere; }
.campo-valor[data-vazio] { color: var(--color-muted); font-weight: var(--wght-small); }
/* The excerpt: who read it (or the page) as a small lead-in, then the words, wrapping as one sentence */
.trecho { margin-top: var(--space-2xs); color: var(--color-ink-2); font-size: 0.9375rem; line-height: 1.6; overflow-wrap: anywhere; }
.trecho q { quotes: "“" "”"; }
.trecho-pagina { margin-right: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-ui); white-space: nowrap; }
button.trecho-pagina {
  display: inline-block;
  min-height: 32px;
  margin-block: -4px;
  line-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
  cursor: pointer;
  transition: text-decoration-color var(--dur-color) var(--ease-out);
}
@media (pointer: coarse) { button.trecho-pagina { min-height: 44px; margin-block: calc(-1 * var(--space-xs)); line-height: 44px; } }
@media (hover: hover) and (pointer: fine) { button.trecho-pagina:hover { text-decoration-color: var(--color-accent); } }
.motivos { margin: var(--space-2xs) 0 0; padding-left: 1.15em; color: var(--color-ink-2); font-size: 0.9375rem; line-height: 1.5; }
.motivos li::marker { color: var(--color-muted); }
.motivos li + li { margin-top: var(--space-3xs); }
.campo-observacao { margin-top: var(--space-2xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); line-height: 1.45; }
.nao-encontrados { max-width: 50ch; margin-top: var(--space-sm); color: var(--color-muted); font-size: 0.9375rem; line-height: 1.5; }

/* Lists inside a document (an extract's lines, a note's items): a ruled table that scrolls sideways on its own */
.tabela-rolagem { margin-top: var(--space-md); overflow-x: auto; border-top: 2px solid var(--color-ink); border-bottom: 1px solid var(--color-rule); -webkit-overflow-scrolling: touch; }
.tabela { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
.tabela th { padding: var(--space-xs) var(--space-sm) var(--space-xs) 0; border-bottom: 1px solid var(--color-rule); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-ui); text-align: left; white-space: nowrap; }
.tabela td { padding: var(--space-xs) var(--space-sm) var(--space-xs) 0; border-bottom: 1px solid var(--color-rule); vertical-align: top; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tr[data-estado="a conferir"] td { background: var(--color-paper-3); }
.tabela .estado-linha { width: 1.5rem; padding-left: var(--space-2xs); }
.estado-ponto { display: inline-block; width: 10px; height: 10px; border: 1.5px solid var(--color-rule-strong); border-radius: 50%; vertical-align: middle; }
.estado-ponto[data-estado="conferido"] { border-color: var(--color-ink); background: var(--color-ink); }
.estado-ponto[data-estado="a conferir"] { border-color: var(--color-accent); background: var(--color-accent); }
.tabela-nota { margin-top: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); line-height: 1.45; }

/* The server's checks: the tag says whether it agrees, the text says which check and on which fields */
.conferencia { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2xs) var(--space-md); padding-block: var(--space-sm); border-bottom: 1px solid var(--color-rule); }
@media (min-width: 40rem) { .conferencia { grid-template-columns: 8.25rem minmax(0, 1fr); align-items: start; } }
.conferencia-marca { justify-self: start; }
.conferencia-texto { min-width: 0; line-height: 1.5; }
.conferencia-texto strong { display: block; font-weight: var(--wght-ui); }
.conferencia-texto > span { display: block; color: var(--color-ink-2); font-size: 0.9375rem; overflow-wrap: anywhere; }
.conferencia-texto small { display: block; margin-top: var(--space-3xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); }

/* What a person would check: plain ruled lines; nothing in doubt is said in an ink-edged note */
.duvidas li { padding-block: var(--space-sm); border-bottom: 1px solid var(--color-rule); line-height: 1.5; overflow-wrap: anywhere; }
.duvidas-nada { max-width: 50ch; margin-top: var(--space-md); padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-ink); border-radius: var(--radius-input); line-height: 1.5; }

/* Another document, and what is left today */
.resultado-mais { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); margin-top: var(--space-lg); }
.resultado-mais p { color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); }
@media (max-width: 39.99rem) { .resultado-mais .btn, .dados .btn { width: 100%; } }
