/* Entrevista do Kit — estilos. Mobile-first, sem framework. */
:root {
  --fundo: #FAF9F6;
  --texto: #1C1F24;
  --texto-2: #5B6068;
  --linha: #E4E1DA;
  --cartao: #FFFFFF;
  --acento: #0B1B33;          /* trocado por config.cor_acento */
  --acento-texto: #FFFFFF;
  --marcacao: #F18921;
  --erro: #B42318;
  --ok: #1B7F4C;
  --raio: 14px;
  --toque: 48px;
  --largura: 560px;
  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font: 17px/1.45 var(--fonte); min-height: 100dvh;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }

.progresso { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--linha); z-index: 20; }
.progresso__barra { height: 100%; width: 0; background: var(--acento); transition: width .3s ease; }

.topo {
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 8px;
  max-width: var(--largura); width: 100%; margin: 0 auto;
}
.topo__marca img { height: 30px; width: auto; }
.topo__titulo { font-size: 13px; color: var(--texto-2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo__contador { font-size: 12px; color: var(--texto-2); font-variant-numeric: tabular-nums; }

.app { flex: 1; width: 100%; max-width: var(--largura); margin: 0 auto; padding: 4px 16px 24px; }
.rodape { text-align: center; font-size: 11px; color: var(--texto-2); padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); letter-spacing: .04em; }

/* ---- Tela ---- */
.tela { display: flex; flex-direction: column; gap: 14px; animation: entra .22s ease both; min-height: 60dvh; }
.tela--saindo { animation: sai .16s ease both; }
@keyframes entra { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes sai { from { opacity: 1; } to { opacity: 0; transform: translateX(-10px); } }
@media (prefers-reduced-motion: reduce) { .tela, .tela--saindo { animation: none; } }

.tela__titulo { font-size: 23px; line-height: 1.22; font-weight: 700; margin: 4px 0 0; letter-spacing: -0.01em; text-wrap: pretty; }
.tela__texto, .tela__ajuda { margin: 0; color: var(--texto-2); font-size: 16px; }
.tela__ajuda { font-size: 15px; }
.tela__reconhecimento { margin: 0; font-size: 15px; color: var(--texto-2); border-left: 3px solid var(--marcacao); padding-left: 10px; }

/* ilustração: "é aqui que isso entra" */
.ilus { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ilus__quadro {
  border: 1px solid var(--linha); border-radius: var(--raio); background: #fff; overflow: hidden;
  display: flex; justify-content: center; max-height: 40dvh; transition: max-height .2s ease;
  cursor: zoom-in;
}
.ilus__quadro img { width: 100%; height: auto; max-height: 40dvh; object-fit: contain; }
.ilus__legenda { font-size: 14px; color: var(--texto-2); margin: 0; }
.ilus__legenda::before { content: ""; display: inline-block; width: 10px; height: 10px; border: 2px solid var(--marcacao); border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
body.teclado .ilus__quadro, body.teclado .ilus__quadro img { max-height: 72px; }
body.teclado .ilus__legenda { display: none; }
.ilus__link { font-size: 14px; color: var(--texto-2); text-decoration: underline; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }

/* campos */
.campo { width: 100%; min-height: var(--toque); padding: 12px 14px; border: 1.5px solid var(--linha); border-radius: 12px; background: var(--cartao); outline: none; }
.campo:focus { border-color: var(--acento); }
textarea.campo { min-height: 112px; resize: vertical; line-height: 1.45; }
.campo::placeholder { color: #9AA0A8; }

/* opções */
.opcoes { display: flex; flex-direction: column; gap: 10px; }
.opcao {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 14px;
  border: 1.5px solid var(--linha); border-radius: 12px; background: var(--cartao); text-align: left; cursor: pointer;
}
.opcao__marca { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #B9BEC6; flex: none; position: relative; }
.opcao[aria-checked="true"] { border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento) inset; }
.opcao[aria-checked="true"] .opcao__marca { border-color: var(--acento); }
.opcao[aria-checked="true"] .opcao__marca::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--acento); }
.opcao__rotulo { flex: 1; }

/* gravação */
.gravar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gravar__botao {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--toque); padding: 0 16px;
  border: 1.5px solid var(--linha); border-radius: 999px; background: var(--cartao); cursor: pointer;
}
.gravar__botao[data-estado="gravando"] { border-color: var(--erro); color: var(--erro); }
.gravar__ponto { width: 12px; height: 12px; border-radius: 50%; background: var(--erro); }
.gravar__botao[data-estado="gravando"] .gravar__ponto { animation: pulsa 1s infinite; }
@keyframes pulsa { 50% { opacity: .3; } }
.gravar__status { font-size: 14px; color: var(--texto-2); }
.gravar audio { width: 100%; margin-top: 4px; }

/* arquivos */
.arquivos { display: flex; flex-direction: column; gap: 12px; }
.arquivos__solta {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px;
  border: 1.5px dashed #B9BEC6; border-radius: 12px; background: var(--cartao); cursor: pointer; padding: 12px;
}
.arquivos__grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.mini { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #EEEBE4; border: 1px solid var(--linha); }
.mini img { width: 100%; height: 100%; object-fit: cover; }
.mini__doc { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; padding: 6px; text-align: center; color: var(--texto-2); word-break: break-all; }
.mini__remover { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(28,31,36,.75); color: #fff; cursor: pointer; font-size: 14px; }
.mini__progresso { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.15); }
.mini__progresso i { display: block; height: 100%; background: var(--acento); width: 0; }
.mini--erro { outline: 2px solid var(--erro); }

/* botões */
.acoes { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 8px; position: sticky; bottom: 0; background: linear-gradient(to top, var(--fundo) 80%, transparent); padding-bottom: 6px; }
.botao {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px;
  border: 0; border-radius: 12px; background: var(--acento); color: var(--acento-texto);
  font-weight: 700; font-size: 17px; cursor: pointer;
}
.botao:disabled { opacity: .45; cursor: default; }
.botao--secundario { background: transparent; color: var(--texto); border: 1.5px solid var(--linha); font-weight: 600; }
.botao--linha { background: none; border: 0; color: var(--texto-2); min-height: 40px; font-weight: 500; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.navegacao { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.navegacao .botao--linha { width: auto; padding: 0 4px; }

/* assistente */
.assistente { display: flex; flex-direction: column; gap: 10px; }
.balao { border: 1px solid var(--linha); background: var(--cartao); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.balao__linha { display: flex; gap: 10px; align-items: flex-start; }
.balao__quem { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--texto-2); flex: none; width: 74px; padding-top: 3px; }
.balao__texto { margin: 0; flex: 1; }
.balao__form { display: flex; gap: 8px; }
.balao__form .campo { min-height: 44px; padding: 8px 12px; }
.balao__form .botao { width: auto; min-height: 44px; padding: 0 14px; }
.balao__nota { font-size: 13px; color: var(--texto-2); margin: 0; }

/* versões redigidas */
.versoes { display: flex; flex-direction: column; gap: 10px; }
.versao { text-align: left; padding: 12px 14px; border: 1.5px solid var(--linha); border-radius: 12px; background: var(--cartao); cursor: pointer; line-height: 1.4; }
.versao[aria-checked="true"] { border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento) inset; }

/* resumo */
.resumo { list-style: none; margin: 0; padding: 0; border: 1px solid var(--linha); border-radius: var(--raio); background: var(--cartao); }
.resumo li { padding: 10px 14px; border-bottom: 1px solid var(--linha); display: flex; flex-direction: column; gap: 2px; }
.resumo li:last-child { border-bottom: 0; }
.resumo__rotulo { font-size: 12px; color: var(--texto-2); text-transform: uppercase; letter-spacing: .05em; }
.resumo__valor { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.resumo__valor--vazio { color: #9AA0A8; }
.resumo__editar { font-size: 13px; color: var(--texto-2); background: none; border: 0; padding: 0; text-align: left; text-decoration: underline; cursor: pointer; }

/* visor de imagem */
.visor { position: fixed; inset: 0; background: rgba(20,22,26,.96); z-index: 50; display: flex; flex-direction: column; }
.visor__fechar { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; z-index: 2; cursor: pointer; }
.visor__rolagem { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; justify-content: center; align-items: flex-start; padding: calc(56px + env(safe-area-inset-top)) 0 24px; }
.visor__rolagem img { width: min(100%, 520px); height: auto; }

/* aviso */
.aviso { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); background: var(--texto); color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 15px; z-index: 40; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.aviso--erro { background: var(--erro); }
.aviso--ok { background: var(--ok); }

/* estados */
.silencio { font-size: 14px; color: var(--texto-2); }
.erro-inline { color: var(--erro); font-size: 14px; margin: 0; }
.selo { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #EEEBE4; color: var(--texto-2); }

/* ---- Painel (/r/) ---- */
.painel { display: flex; flex-direction: column; gap: 18px; }
.painel__cabecalho { display: flex; flex-direction: column; gap: 4px; }
.painel__acoes { display: flex; gap: 10px; flex-wrap: wrap; }
.painel__acoes .botao { width: auto; min-height: 46px; padding: 0 16px; font-size: 15px; }
.painel h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-2); margin: 12px 0 6px; }
.painel .resumo__valor a { word-break: break-all; }
.painel__arquivos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 6px; }
.painel__arquivos a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #EEEBE4; border: 1px solid var(--linha); font-size: 12px; color: var(--texto-2); text-align: center; text-decoration: none; }
.painel__arquivos a img { width: 100%; height: 100%; object-fit: cover; }
.painel__arquivos a span { display: flex; align-items: center; justify-content: center; height: 100%; padding: 6px; word-break: break-all; }
.painel pre { white-space: pre-wrap; word-break: break-word; font-size: 13px; background: var(--cartao); border: 1px solid var(--linha); border-radius: 12px; padding: 12px; max-height: 50dvh; overflow: auto; }

@media (min-width: 600px) {
  .tela__titulo { font-size: 26px; }
  .acoes { position: static; background: none; }
}
