/* Cores com contraste verificado: texto normal ≥ 4,5:1, componentes ≥ 3:1 (WCAG 2.2 AA). */
:root {
  --fundo: #f6f5f2;
  --superficie: #ffffff;
  --superficie-2: #eeece6;
  --texto: #1b1a17;
  --suave: #5a564e;
  --borda: #cfcbc0;
  --borda-forte: #8a8578;
  --marca: #14213d;
  --sobre-marca: #f6f5f2;
  --acento: #a8470f;
  --sobre-acento: #ffffff;
  --verde: #0b6b6a;
  --perigo: #b3261e;
  --aviso: #8a5a00;
  --foco: #0b57d0;
  --fundo-info: #e8f0f7;
  --fundo-erro: #fbe9e7;
  --fundo-ok: #e4f2ee;
  --fundo-aviso: #fbf0d9;
  --sombra: 0 1px 2px rgb(0 0 0 / 0.08);
  --raio: 10px;
  color-scheme: light;
}
:root[data-tema="dark"] {
  --fundo: #14130f;
  --superficie: #1d1b17;
  --superficie-2: #26241f;
  --texto: #f1ede2;
  --suave: #b9b3a4;
  --borda: #3a372f;
  --borda-forte: #8f897a;
  --marca: #0e0d0a;
  --sobre-marca: #f1ede2;
  --acento: #f0a63c;
  --sobre-acento: #14130f;
  --verde: #5cc9c7;
  --perigo: #ff8a80;
  --aviso: #f2c04e;
  --foco: #8ab4ff;
  --fundo-info: #1b2733;
  --fundo-erro: #3a1f1c;
  --fundo-ok: #17302c;
  --fundo-aviso: #3a2f14;
  --sombra: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
img, svg { max-width: 100%; }
a { color: var(--acento); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; border-radius: 3px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0.4em 0 0.6em; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 1.2em 0 0.5em; }
p { margin: 0.5em 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--superficie-2); padding: 0.75em; border-radius: 6px; margin: 0.5em 0; }
.suave { color: var(--suave); }
.so-leitor { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.saltar { position: absolute; left: 8px; top: -60px; background: var(--acento); color: var(--sobre-acento); padding: 0.6em 1em; border-radius: 6px; z-index: 100; font-weight: 600; }
.saltar:focus { top: 8px; }
.grande-texto { font-size: 1.25rem; }

/* topo */
.topo { background: var(--marca); color: var(--sobre-marca); }
.topo a { color: var(--sobre-marca); }
.topo-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; padding: 0.6rem 16px; max-width: 1400px; margin: 0 auto; }
.marca { display: flex; flex-direction: column; line-height: 1.15; text-decoration: none; margin-right: auto; }
.marca-nome { font-weight: 700; font-size: 1.05rem; }
.marca-cliente { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
.menu ul, .linguas { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.menu a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.8rem; border-radius: 8px; text-decoration: none; }
.menu a:hover { background: rgb(255 255 255 / 0.12); }
.menu a[aria-current="page"] { background: rgb(255 255 255 / 0.2); font-weight: 700; box-shadow: inset 0 -3px 0 var(--acento); }
.ferramentas { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; order: 3; }
/* Em ecrã largo, a língua, o tema e a conta ficam sempre em cima, à direita, e o menu numa linha própria por
   baixo. Antes o menu ocupava a linha de cima e empurrava estes botões para uma segunda linha, à esquerda, onde
   não se davam por eles com a janela maximizada. */
@media (min-width: 900px) {
  .topo .menu { order: 4; flex-basis: 100%; }
}
.linguas a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 8px; text-decoration: none; font-size: 0.85rem; }
.linguas a[aria-current="true"] { background: rgb(255 255 255 / 0.2); font-weight: 700; }
.pessoa { font-size: 0.9rem; display: inline-flex; flex-direction: column; line-height: 1.2; }
.pessoa-papel { font-size: 0.75rem; opacity: 0.85; }
.botao-menu, .botao-tema, .botao-sair {
  min-height: 44px; padding: 0 0.9rem; border: 1px solid rgb(255 255 255 / 0.5); border-radius: 8px;
  background: transparent; color: var(--sobre-marca); font: inherit; cursor: pointer;
}
.botao-menu:hover, .botao-tema:hover, .botao-sair:hover { background: rgb(255 255 255 / 0.15); }
.form-sair { margin: 0; }
.botao-menu { display: none; }
.faixa-demo { background: var(--fundo-aviso); color: var(--texto); padding: 0.5rem 16px; text-align: center; border-bottom: 2px solid var(--aviso); }

/* conteúdo */
main { margin: 0 auto; padding: 1rem 16px 5rem; }
main.estreito { max-width: 920px; }
main.largo { max-width: 1400px; }
main:focus { outline: none; }
.rodape { max-width: 1400px; margin: 0 auto; padding: 1rem 16px 2rem; color: var(--suave); font-size: 0.85rem; }
.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1rem 1.25rem; margin: 1rem 0; box-shadow: var(--sombra); }
.cartao h2:first-child { margin-top: 0.2em; }
.cartao.destaque { border-left: 6px solid var(--acento); }
.cartao.centrado { text-align: center; max-width: 640px; margin-inline: auto; }
.estreito-form { max-width: 460px; margin-inline: auto; }
.aviso { padding: 0.75rem 1rem; border-radius: 8px; margin: 0.75rem 0; border: 1px solid var(--borda-forte); }
.aviso p { margin: 0.25em 0; }
.aviso-ok { background: var(--fundo-ok); }
.aviso-erro { background: var(--fundo-erro); border-color: var(--perigo); }
.aviso-info { background: var(--fundo-info); }
.migalhas ol { list-style: none; display: flex; gap: 0.5rem; padding: 0; margin: 0.25rem 0; font-size: 0.9rem; }
.migalhas li + li::before { content: "›"; margin-right: 0.5rem; color: var(--suave); }

/* botões e campos */
.botao {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.4rem 1.1rem;
  border-radius: 8px; border: 2px solid var(--borda-forte); background: var(--superficie); color: var(--texto);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.botao:hover { background: var(--superficie-2); }
.botao.primario { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.botao.primario:hover { filter: brightness(1.08); background: var(--acento); }
.botao.grande { min-height: 52px; font-size: 1.1rem; padding-inline: 1.6rem; }
.botao[disabled], button[disabled] { opacity: 0.55; cursor: not-allowed; }
.botoes { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.botoes form { margin: 0; }
.botao.pequeno { min-height: 44px; padding: 0.3rem 0.8rem; font-size: 0.95rem; }
.campo { margin: 0.9rem 0; }
.campo label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input[type="text"], input[type="search"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; padding: 0.5rem 0.7rem; font: inherit; color: var(--texto); background: var(--superficie);
  border: 2px solid var(--borda-forte); border-radius: 8px;
}
textarea { resize: vertical; }
input[type="file"] { width: 100%; padding: 0.5rem 0; font: inherit; }
fieldset { border: 1px solid var(--borda); border-radius: 8px; padding: 0.5rem 1rem 0.75rem; margin: 0.75rem 0; min-width: 0; }
legend { font-weight: 700; padding: 0 0.4rem; }
fieldset.envolvente { border: 0; padding: 0; margin: 0; }
.titulo-form { font-size: 1.25rem; margin: 0 0 0.4rem; }

/* lista de números */
.numeros { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.numero { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 0.8rem 1rem; }
.numero a { text-decoration: none; display: flex; flex-direction: column; color: var(--texto); }
.numero a:hover .numero-rotulo { text-decoration: underline; }
.numero-valor { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.numero-rotulo { font-weight: 600; color: var(--acento); }
.numero-ajuda { display: block; font-size: 0.85rem; margin-top: 0.25rem; }
.lista-simples { padding-left: 1.2rem; }
.lista-simples li { margin: 0.25rem 0; }

/* tabelas */
/* position: relative é o que impede o texto escondido (.so-leitor, absoluto) de escapar ao recorte e esticar a página */
.tabela-envolvente { position: relative; overflow-x: auto; border: 1px solid var(--borda); border-radius: var(--raio); background: var(--superficie); }
.tabela { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.tabela th, .tabela td { padding: 0.55rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--borda); }
.tabela thead th { background: var(--superficie-2); position: sticky; top: 0; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.tabela tbody th[scope="row"] { font-weight: 600; background: var(--superficie); position: sticky; left: 0; }
.tabela .num { text-align: right; white-space: nowrap; }
.celula-assunto { min-width: 14rem; max-width: 28rem; overflow-wrap: anywhere; }
.ligacao-acao { font-weight: 600; white-space: nowrap; }
.codigos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.codigo { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; background: var(--superficie-2); border: 1px solid var(--borda); border-radius: 4px; padding: 0 0.3rem; white-space: nowrap; }
.estado { display: inline-block; font-weight: 600; font-size: 0.9rem; }
.estado-pendente { color: var(--aviso); }
.estado-feita { color: var(--verde); }
.estado-duvidas { color: var(--aviso); }
.estado-repetida, .estado-neutro { color: var(--suave); }
.estado-erro { color: var(--perigo); display: block; }
.estado-erro p { color: var(--texto); }
.estado-erro p:first-child { color: var(--perigo); }
.barra { display: inline-block; vertical-align: middle; width: 90px; height: 8px; background: var(--superficie-2); border: 1px solid var(--borda-forte); border-radius: 4px; margin-left: 0.4rem; overflow: hidden; }
.barra-cheia { display: block; height: 100%; background: var(--verde); }
.filtros { display: grid; gap: 0.5rem 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 0.75rem 1rem; }
.filtros .campo { margin: 0; }
.contagem { font-weight: 600; margin: 0.9rem 0 0.4rem; }
.paginacao { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }
.selo { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0 0.4rem; border-radius: 4px; background: var(--fundo-aviso); border: 1px solid var(--aviso); color: var(--texto); vertical-align: middle; }
.nota { display: block; font-size: 0.85rem; color: var(--texto); border-left: 3px solid var(--acento); padding-left: 0.5rem; margin-top: 0.15rem; }
.lista-assuntos { list-style: none; padding: 0; margin: 0; }
.lista-assuntos li { padding: 0.6rem 0; border-top: 1px solid var(--borda); }
.cartoes-caixa { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cartoes-caixa .cartao { margin: 0; }
.cartoes-caixa h2 { font-size: 1.05rem; word-break: break-all; }
.tecnico summary { cursor: pointer; color: var(--suave); font-size: 0.85rem; min-height: 32px; }
.lista-erros { padding-left: 1.2rem; }
.palavra-passe { font-size: 1.5rem; background: var(--superficie-2); padding: 0.3rem 0.6rem; border-radius: 6px; user-select: all; }

/* ecrã de classificação */
.duas-colunas { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.mensagem { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1rem 1.25rem; }
.olho { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--suave); margin: 0; overflow-wrap: anywhere; }
.meta { margin: 0.5rem 0; display: grid; gap: 0.15rem; }
.meta div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.5rem; }
.meta dt { color: var(--suave); font-weight: 600; }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.posicao { background: var(--fundo-info); border-radius: 6px; padding: 0.4rem 0.7rem; font-size: 0.9rem; }
.corpo { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--fundo); border: 1px solid var(--borda); border-radius: 8px; padding: 0.8rem 1rem; max-height: 55vh; overflow: auto; font-size: 0.98rem; }
.anexos ul { list-style: none; padding: 0; margin: 0; }
.anexos li { padding: 0.4rem 0; border-top: 1px solid var(--borda); display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: center; }
.anexo-nome { font-weight: 600; overflow-wrap: anywhere; }
.dica { background: var(--fundo-info); border-radius: 8px; padding: 0.4rem 0.9rem; margin-top: 1rem; font-size: 0.92rem; }
.coluna-form { min-width: 0; }
.classificacao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1rem 1.25rem 0; }
.ajuda { margin-top: 0; }
.resumo-escolha { background: var(--fundo-ok); border: 1px solid var(--verde); border-radius: 8px; padding: 0.5rem 0.8rem; margin: 0.75rem 0; font-size: 0.93rem; overflow-wrap: anywhere; }
.resumo-escolha.vazio { background: var(--superficie-2); border-color: var(--borda-forte); }
.categoria { border: 1px solid var(--borda); border-radius: 8px; margin: 0.6rem 0; background: var(--superficie); }
.categoria > summary, .duvidas > summary, .mais > summary { cursor: pointer; font-weight: 700; padding: 0.6rem 0.8rem; min-height: 44px; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.categoria[open] > summary { border-bottom: 1px solid var(--borda); background: var(--superficie-2); border-radius: 8px 8px 0 0; }
.categoria-codigo { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--acento); }
.categoria-contagem { margin-left: auto; font-size: 0.82rem; font-weight: 600; color: var(--verde); }
.categoria-pergunta { margin: 0.4rem 0.8rem; font-size: 0.9rem; }
.opcoes { padding: 0 0.4rem 0.4rem; }
.opcao { display: flex; gap: 0.7rem; align-items: flex-start; min-height: 44px; padding: 0.55rem 0.5rem; border-radius: 8px; cursor: pointer; }
.opcao:hover { background: var(--superficie-2); }
.opcao input { flex: none; width: 24px; height: 24px; margin: 0.1rem 0 0; accent-color: var(--acento); }
.opcao:has(input:checked) { background: var(--fundo-ok); outline: 2px solid var(--verde); outline-offset: -2px; }
.opcao-texto { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.opcao-titulo { display: block; }
.duvidas, .mais { border: 1px dashed var(--borda-forte); border-radius: 8px; margin: 0.8rem 0; padding: 0 0.4rem 0.4rem; }
.duvidas > p, .mais > .campo { margin-inline: 0.6rem; }
.certeza { margin: 0.8rem 0; }
.barra-acoes { position: sticky; bottom: 0; background: var(--superficie); border-top: 2px solid var(--borda); margin: 0.75rem -1.25rem 0; padding: 0.6rem 1.25rem calc(0.6rem + env(safe-area-inset-bottom)); border-radius: 0 0 var(--raio) var(--raio); z-index: 5; }
/* Espaço reservado para duas linhas: uma mensagem nova nunca empurra os botões debaixo do dedo. */
.estado-guardar { min-height: 3.1em; margin: 0 0 0.4rem; font-size: 0.9rem; color: var(--suave); }
.estado-guardar.erro { color: var(--perigo); font-weight: 600; }
.estado-guardar.ok { color: var(--verde); font-weight: 600; }
.historico { margin: 1rem 0; }
.historico summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.historico ol { padding-left: 1.2rem; }
.historico li { margin: 0.5rem 0; }
.recuperar { margin: 0.75rem 0; }

.titulo-com-acao { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; }
.importar-caixa summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.form-importar { margin-top: 0.4rem; }
.tabela tbody th.celula-assunto a { font-weight: 600; }

@media (min-width: 1000px) {
  .duas-colunas { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .mensagem { position: sticky; top: 0.75rem; max-height: calc(100vh - 1.5rem); overflow: auto; }
}
/* Em ecrãs estreitos a mensagem e o formulário ficam um por baixo do outro: a barra de ações fixa-se ao fundo,
   para a ação principal nunca ficar fora do ecrã, e a página reserva espaço para ela não tapar o fim do conteúdo. */
@media (max-width: 999px) {
  html { scroll-padding-bottom: 10rem; }
  .barra-acoes { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 0; box-shadow: 0 -4px 14px rgb(0 0 0 / 0.18); }
  .barra-acoes .botoes { flex-wrap: wrap; }
  .classificacao { padding-bottom: 9rem; }
  /* Enquanto se escreve num campo de texto, o teclado do telemóvel ocupa o fundo do ecrã: a barra deixa de
     estar presa ao fundo, para nunca tapar o campo nem ficar escondida atrás do teclado. */
  .a-escrever .barra-acoes { position: static; box-shadow: none; margin: 0.75rem -1.25rem 0; }
}
@media (max-width: 899px) {
  .js .botao-menu { display: inline-flex; align-items: center; }
  .js .menu { display: none; width: 100%; order: 10; }
  .js .menu.aberto { display: block; }
  .menu ul { flex-direction: column; }
  .menu a { width: 100%; }
  .meta div { grid-template-columns: 1fr; gap: 0; }
  .corpo { max-height: 40vh; }
}
@media (max-width: 520px) {
  main { padding-inline: 12px; }
  .botoes .botao, .barra-acoes .botao { flex: 1 1 100%; }
  h1 { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* separadores da lista e menu da ordem */
.barra-lista { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between; margin: 0.75rem 0; }
.separadores { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0; margin: 0; border-bottom: 2px solid var(--borda); }
.separadores a {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0.35rem 0.9rem;
  color: var(--texto); text-decoration: none; font-weight: 600; border-radius: 8px 8px 0 0; margin-bottom: -2px;
  border-bottom: 3px solid transparent;
}
.separadores a:hover { background: var(--superficie-2); }
.separadores a[aria-current="page"] { border-bottom-color: var(--acento); color: var(--acento); }
.separador-n { font-weight: 400; font-size: 0.9rem; color: var(--suave); }
.separadores a[aria-current="page"] .separador-n { color: inherit; }
.form-ordem { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.5rem 0; }
.form-ordem label { font-weight: 600; }
.form-ordem select { width: auto; }

/* sugestão automática */
.aviso.sugestao { border-left: 6px solid var(--foco); }
.selo-sugestao { border-color: var(--foco); color: var(--texto); background: var(--fundo-info); }

/* pré-classificação com IA, na lista e na janela das evidências */
.pre-ia { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; text-decoration: none; color: var(--texto);
  padding: 0.25rem 0.4rem; border: 1px dashed var(--foco); border-radius: 8px; min-height: 44px; }
.pre-ia:hover { background: var(--fundo-info); }
.janela-sugestao { width: min(680px, calc(100vw - 32px)); max-height: 88vh; overflow: auto; padding: 1rem 1.25rem; border: 1px solid var(--borda-forte);
  border-radius: var(--raio); background: var(--superficie); color: var(--texto); box-shadow: var(--sombra); }
.janela-sugestao::backdrop { background: rgb(0 0 0 / 0.55); }
.janela-cabeca { display: grid; grid-template-columns: 1fr auto; gap: 0 0.75rem; align-items: start; }
.janela-cabeca .olho { grid-column: 1 / -1; margin: 0; }
.janela-cabeca h2 { margin: 0.2rem 0; font-size: 1.15rem; }
.janela-inicio { margin: 0.5rem 0; padding: 0.5rem 0.75rem; border-left: 3px solid var(--borda-forte); background: var(--superficie-2); font-size: 0.95rem; }
.janela-candidatos { border: 0; padding: 0; margin: 0.75rem 0; }
.janela-candidatos legend { font-weight: 600; margin-bottom: 0.5rem; }
.janela-candidato { border: 1px solid var(--borda); border-radius: 8px; padding: 0.5rem 0.75rem; margin: 0.5rem 0; }
.janela-candidato.marcado { border-color: var(--foco); }
.janela-rotulo { display: flex; gap: 0.6rem; align-items: flex-start; min-height: 44px; cursor: pointer; }
.janela-rotulo input { width: 1.3rem; height: 1.3rem; margin-top: 0.15rem; flex: none; }
.janela-porque { margin: 0.25rem 0 0 1.9rem; }
.janela-evidencias { margin: 0.25rem 0 0 1.9rem; padding-left: 1rem; }
.janela-evidencias q { font-style: italic; }
.janela-duvidas { display: flex; gap: 0.5rem; align-items: center; min-height: 44px; }
.confianca-alta { border-color: var(--ok, #2e7d32); }
.confianca-baixa { opacity: 0.85; }
.ligacao-porque { background: none; border: 0; padding: 0 0.25rem; color: var(--acento); text-decoration: underline; font: inherit; font-size: 0.9rem; cursor: pointer; min-height: 32px; }
.corpo mark { background: var(--fundo-aviso); color: inherit; padding: 0 0.1rem; border-bottom: 2px solid var(--aviso); }

/* Um assunto sugerido pela IA: a opção e, ao lado, o «Porquê?» que abre as evidências */
.opcao-linha { display: flex; align-items: flex-start; gap: 0.25rem; }
.opcao-linha > .opcao { flex: 1; min-width: 0; }
.opcao-linha > .ligacao-porque { flex: none; margin-top: 0.55rem; }
.pre-ia-assunto { display: block; font-size: 0.9rem; line-height: 1.3; }
.pre-ia-assunto .codigo { font-size: 0.8rem; }

/* ---------- vistoria do perito (PT08): pensada para o telemóvel, com uma mão e no local ---------- */
.lista-vistorias { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.vistoria-cartao { padding: 0; }
.vistoria-ligacao { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.9rem; align-items: start; padding: 0.9rem 1rem;
  color: var(--texto); text-decoration: none; min-height: 44px; border-radius: var(--raio); }
.vistoria-ligacao:hover { background: var(--superficie-2); }
.vistoria-hora { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.vistoria-resumo { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.vistoria-ligacao .selo-estado-vistoria { grid-column: 2; justify-self: start; }
.selo-estado-vistoria { border: 1px solid var(--borda-forte); }
.estado-iniciada, .estado-em_recolha { background: var(--fundo-info); }
.estado-recolha_concluida, .estado-pronta_relatorio { background: var(--fundo-ok); }
.estado-aguarda_elementos, .estado-sem_acesso, .estado-interveniente_ausente, .estado-nova_deslocacao { background: var(--fundo-aviso); }
.vistoria-cabecalho h1 { margin: 0.1rem 0 0.4rem; }
.eyebrow { margin: 0; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--suave); }
/* Só na vistoria: o botão de iniciar ocupa a largura toda (a entrada e a triagem mantêm o seu). */
.vistoria-cabecalho .botao.grande { width: 100%; }
.formulario-vistoria { display: grid; gap: 1rem; }
.bloco-vistoria h2 { margin-top: 0; }
.campo-vistoria { margin: 0.9rem 0; }
.campo-vistoria input[type="text"], .campo-vistoria input[type="date"], .campo-vistoria textarea,
.dano-form select, .dano-form textarea { width: 100%; font-size: 1rem; min-height: 44px; }
.escolhas { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.escolhas > legend { width: 100%; margin-bottom: 0.35rem; }
.escolhas > .ajuda { width: 100%; }
.escolha { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0.45rem 0.9rem;
  border: 1px solid var(--borda-forte); border-radius: 999px; background: var(--superficie); cursor: pointer; }
.escolha input { width: 20px; height: 20px; margin: 0; accent-color: var(--acento); }
.escolha:has(input:checked) { background: var(--fundo-ok); border-color: var(--verde); font-weight: 600; }
.escolha:has(input:focus-visible) { outline: 3px solid var(--foco); outline-offset: 2px; }
.escolhas-tipologia .escolha { flex: 1 1 calc(50% - 0.5rem); }
.selo-obrigatorio { background: var(--fundo-aviso); }
.lista-danos { list-style: none; margin: 0 0 0.9rem; padding: 0; display: grid; gap: 0.75rem; }
.dano { background: var(--superficie-2); }
.dano h3 { margin: 0 0 0.4rem; }
.dano-form { display: grid; gap: 0.35rem; }
.estado-guardar.erro { color: var(--perigo); font-weight: 600; }
.estado-global { position: sticky; bottom: 0; margin: 0; padding: 0.4rem 0; background: var(--fundo); min-height: 1.6em; }
@media (min-width: 760px) {
  .escolhas-tipologia .escolha { flex: 0 1 auto; }
}
details.bloco-vistoria > summary { cursor: pointer; list-style: revert; min-height: 44px; }
details.bloco-vistoria > summary h2 { display: inline; margin: 0; }
.evidencias { border-top: 1px solid var(--borda); margin-top: 0.9rem; padding-top: 0.6rem; }
.evidencias h4 { margin: 0.6rem 0 0.35rem; }
.miniaturas { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.miniatura { display: flex; flex-direction: column; gap: 0.25rem; width: 112px; }
.miniatura img { width: 112px; height: 112px; object-fit: cover; border-radius: 8px; border: 1px solid var(--borda); background: var(--superficie-2); }
.miniatura select { width: 100%; font-size: 0.85rem; min-height: 36px; }
.botoes-foto { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.botao-foto { position: relative; display: inline-flex; align-items: center; min-height: 48px; cursor: pointer; }
.botao-foto:has(input:focus-visible) { outline: 3px solid var(--foco); outline-offset: 2px; }
.ligacao-botao { background: none; border: 0; padding: 0.25rem 0; color: var(--acento); text-decoration: underline; font: inherit; cursor: pointer; min-height: 36px; }
.form-inline { display: inline; }
.lista-medicoes { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.acrescentar-medicao > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--acento); text-decoration: underline; }
.form-medicao { display: grid; gap: 0.35rem; }
.form-medicao input, .form-medicao select, .form-medicao textarea { width: 100%; min-height: 44px; font-size: 1rem; }
.medicao-valores { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 0.5rem; }
.aviso-curto { margin: 0.5rem 0; padding: 0.5rem 0.7rem; font-size: 0.9rem; }
.aviso-aviso { background: var(--fundo-aviso); border-color: var(--aviso); }
/* notas por voz */
.botao-voz { position: relative; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 48px; cursor: pointer; margin-top: 0.25rem; }
.botao-voz::before, .botao-voz-foto::before { content: ""; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--perigo); flex: none; }
.botao-voz:has(input:focus-visible) { outline: 3px solid var(--foco); outline-offset: 2px; }
.botao-voz[hidden], .botao-voz-foto[hidden] { display: none; }
.botao-voz-foto { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 40px; padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.lista-notas { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.nota-voz { border: 1px solid var(--borda); border-radius: var(--raio); padding: 0.7rem; background: var(--superficie); }
.nota-voz audio { width: 100%; margin: 0.35rem 0; }
.nota-sobre { margin: 0; font-size: 0.92rem; }
.nota-comparar { display: grid; gap: 0.6rem; }
.nota-comparar h5 { margin: 0.2rem 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--suave); }
.nota-disse p { margin: 0; padding: 0.5rem 0.6rem; border-left: 3px solid var(--borda-forte); background: var(--fundo); font-style: italic; }
.nota-frase textarea { width: 100%; min-height: 5.5rem; font-size: 1rem; line-height: 1.45; field-sizing: content; resize: vertical; }
.form-decidir-nota .estado-guardar { margin: 0.25rem 0 0; min-height: 1.2em; }
.nota-avisos { margin: 0.3rem 0; padding-left: 1.1rem; color: var(--aviso); font-size: 0.9rem; }
.nota-aceite { margin: 0.2rem 0; color: var(--verde); font-weight: 600; }
.nota-frase-final { margin: 0.2rem 0; }
.botoes-nota { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.4rem; }
.botoes-nota .botao { min-height: 44px; }
.nota-detalhe { margin-top: 0.4rem; font-size: 0.85rem; color: var(--suave); }
.nota-detalhe > summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; }
@media (min-width: 760px) {
  .nota-comparar { grid-template-columns: 1fr 1fr; }
}
/* O gravador fica preso ao fundo do ecrã enquanto grava; vive no body, fora de qualquer bloco com filtros. */
.gravador { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); background: var(--superficie); border-top: 2px solid var(--perigo); box-shadow: 0 -2px 8px rgb(0 0 0 / 0.15); }
.gravador[hidden] { display: none; }
.gravador-texto { margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-weight: 600; }
.gravador-ponto { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--perigo); animation: gravador-pulsar 1s ease-in-out infinite; }
.gravador-tempo { font-variant-numeric: tabular-nums; }
.gravador-botoes { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gravador-botoes .botao { min-height: 48px; flex: 1 1 8rem; }
@keyframes gravador-pulsar { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) {
  .gravador-ponto { animation: none; }
}
/* pendências (PT08-08) */
.lista-pendencias { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.pendencia { border: 1px solid var(--borda); border-radius: var(--raio); padding: 0.6rem 0.7rem; background: var(--superficie); }
.pendencia p { margin: 0.15rem 0; }
.pendencia-titulo { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.selo-pendencia-aberta, .selo-atrasada { background: var(--fundo-aviso); }
.selo-pendencia-recebida { background: var(--fundo-ok); }
.selo-pendencia-anulada { background: var(--fundo); }
.botoes-pendencia { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.35rem; }
.botoes-pendencia .botao { min-height: 44px; }
.rascunho-supervisao textarea { width: 100%; font-size: 0.95rem; line-height: 1.45; }
.rascunho-supervisao > summary, .pendencias-anuladas > summary, .pedir-documento > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.form-pedir-documento { display: grid; gap: 0.35rem; max-width: 28rem; }
.form-pedir-documento select { min-height: 44px; font-size: 1rem; }
/* antes de sair do local (PT08-10) */
.lista-faltas { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.5rem; }
.falta { border-left: 3px solid var(--aviso); padding: 0.35rem 0 0.35rem 0.6rem; }
.falta p { margin: 0 0 0.3rem; }
.botoes-falta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; }
.botoes-falta .botao { min-height: 44px; display: inline-flex; align-items: center; }
.justificar { flex: 1 1 16rem; }
.justificar > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--acento); text-decoration: underline; }
.justificar textarea { width: 100%; font-size: 1rem; }
#antes-de-sair .botao.grande { width: 100%; }
/* orçamento e acordo (PT08-11) */
.tabela-rolar { overflow-x: auto; }
.tabela-orcamento { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.tabela-orcamento th, .tabela-orcamento td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--borda); text-align: left; vertical-align: top; }
.tabela-orcamento .num { text-align: right; white-space: nowrap; }
.tabela-orcamento tfoot th, .tabela-orcamento tfoot td { border-bottom: 0; border-top: 2px solid var(--borda-forte); }
.form-orcamento { display: grid; gap: 0.35rem; max-width: 32rem; }
.form-orcamento input, .form-orcamento select { min-height: 44px; font-size: 1rem; width: 100%; }
.acrescentar-linha > summary, .registar-acordo > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--acento); text-decoration: underline; }
.ata { white-space: pre-wrap; font-family: inherit; font-size: 1rem; line-height: 1.6; margin: 0; }
@media print {
  .nao-imprimir, .topo, .rodape, .faixa-demo, .saltar { display: none !important; }
  body { background: #fff; color: #000; }
  .documento-ata { border: 0; box-shadow: none; padding: 0; }
}
/* No telemóvel, cada tarefa do orçamento é um cartão, e o total fica à vista. */
@media (max-width: 640px) {
  .tabela-orcamento thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tabela-orcamento, .tabela-orcamento tbody, .tabela-orcamento tfoot, .tabela-orcamento tr, .tabela-orcamento th, .tabela-orcamento td { display: block; width: 100%; }
  .tabela-orcamento tbody tr { border: 1px solid var(--borda); border-radius: var(--raio); padding: 0.5rem 0.6rem; margin-bottom: 0.5rem; }
  .tabela-orcamento tbody th { border: 0; padding: 0 0 0.25rem; font-weight: 600; }
  .tabela-orcamento td { border: 0; padding: 0.15rem 0; text-align: left; display: flex; justify-content: space-between; gap: 1rem; }
  .tabela-orcamento td[data-rotulo]::before { content: attr(data-rotulo); color: var(--suave); }
  .tabela-orcamento td.acoes-linha { justify-content: flex-end; }
  .tabela-orcamento tfoot tr { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--borda-forte); padding-top: 0.4rem; }
  .tabela-orcamento tfoot th, .tabela-orcamento tfoot td { border: 0; width: auto; padding: 0; }
  .tabela-orcamento tfoot td.vazia { display: none; }
}
/* auto de vistoria (PT08-12) */
.documento-auto h2 { margin-top: 1.25rem; border-bottom: 1px solid var(--borda); padding-bottom: 0.2rem; }
.auto-dl { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; gap: 0.25rem 1rem; margin: 0.4rem 0; }
.auto-dl dt { color: var(--suave); }
.auto-dl dd { margin: 0; }
.auto-lista { margin: 0.3rem 0; padding-left: 1.1rem; display: grid; gap: 0.2rem; }
.auto-fotos { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.6rem; }
.auto-fotos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--borda); }
.auto-fotos span { display: block; font-size: 0.85rem; color: var(--suave); }
.auto-dano { border-left: 3px solid var(--borda-forte); padding-left: 0.7rem; margin: 0.8rem 0; }
.auto-rodape { margin-top: 1.5rem; }
@media (max-width: 640px) {
  .auto-dl { grid-template-columns: 1fr; }
  .auto-dl dd { margin-bottom: 0.3rem; }
}
@media print {
  .documento-auto { border: 0; box-shadow: none; padding: 0; }
  .auto-fotos { grid-template-columns: repeat(3, 1fr); }
  .auto-dano, .auto-fotos li { break-inside: avoid; }
}
/* pré-relatório (PT08-13) */
.relatorio-seccao { margin: 1rem 0; }
.relatorio-seccao h2 { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.relatorio-seccao p { margin: 0.25rem 0; line-height: 1.55; }
.relatorio-lista { margin: 0.25rem 0; padding-left: 1.2rem; }
.corrigir-seccao > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--acento); text-decoration: underline; }
.corrigir-seccao textarea { width: 100%; font-size: 1rem; line-height: 1.45; field-sizing: content; min-height: 6rem; }
.lista-impedimentos { padding-left: 1.2rem; }
.relatorio-rodape { margin-top: 1.25rem; font-size: 0.9rem; }
