:root {
  --bg: #f7f8fb; --card: #ffffff; --border: #e5e8ee; --text: #0f172a; --muted: #5b6473;
  --accent: #0369a1; --accent-hover: #075985; --accent-soft: #f0f7fd;
  --ok: #15803d; --ok-soft: #ecfdf3; --warn: #b45309; --warn-soft: #fffbeb; --err: #b91c1c; --err-soft: #fef2f2;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.25; margin-bottom: .75rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin-bottom: .75rem; }
h3 { font-size: 1rem; }
p + p { margin-top: .5rem; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; background: var(--accent-soft); padding: .1em .35em; border-radius: 4px; }

.topo { background: var(--card); border-bottom: 1px solid var(--border); }
.topo-dentro { max-width: 880px; margin: 0 auto; padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.marca { display: flex; align-items: center; gap: .75rem; color: var(--text); font-weight: 600; }
.marca:hover { text-decoration: none; color: var(--text); }
.marca img { height: 28px; width: auto; }
.marca span { border-left: 1px solid var(--border); padding-left: .75rem; color: var(--muted); font-size: .95rem; }
.quem { display: flex; align-items: center; gap: .75rem; font-size: .9rem; color: var(--muted); }

main { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 2rem 1rem 3rem; }
main.estreito { max-width: 460px; }
.rodape { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem 1rem; }

.cartao, .bloco { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.bloco { margin-top: 1.25rem; }
.suave { color: var(--muted); }
.pequeno { font-size: .875rem; }
.passo { color: var(--accent); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .25rem; }
.migalha { font-size: .9rem; margin-bottom: .5rem; }

.pilha { display: grid; gap: 1rem; margin: 1.25rem 0; }
label { display: grid; gap: .35rem; font-weight: 500; font-size: .95rem; }
input:not([type=radio]):not([type=checkbox]), textarea, select {
  width: 100%; font: inherit; padding: .6rem .75rem; border: 1px solid #cfd5df; border-radius: 8px; background: #fff; color: var(--text);
}
select { width: auto; padding: .35rem .5rem; font-size: .875rem; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.botao { font: inherit; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: .65rem 1.2rem; cursor: pointer; }
.botao:hover { background: var(--accent-hover); }
.botao.secundario { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.botao.secundario:hover { background: var(--accent-soft); }
.link { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.link:hover { text-decoration: underline; }

.alerta { background: var(--err-soft); color: var(--err); border: 1px solid #fecaca; border-radius: 8px; padding: .6rem .8rem; margin-top: 1rem; }
.alerta ul { margin: .4rem 0 0 1.2rem; }
.aviso { background: var(--accent-soft); border: 1px solid #bae0f7; border-radius: 8px; padding: .6rem .8rem; margin: 1rem 0; }
.ok { color: var(--ok); font-weight: 500; margin-top: 1rem; }

.progresso { margin-bottom: 1rem; }
progress { width: 100%; height: 10px; border: 0; border-radius: 99px; overflow: hidden; background: var(--border); appearance: none; }
progress::-webkit-progress-bar { background: var(--border); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--ok); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--ok); }

.marcos { list-style: none; display: grid; gap: .5rem; }
.marco { display: flex; gap: 1rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 10px; }
.marco > div { flex: 1; }
.marco p { font-size: .95rem; }
.marco.st-concluido { background: #fbfefc; }
.selo { flex: none; display: inline-block; font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); background: #fff; white-space: nowrap; }
.selo.st-concluido, .st-concluido > .selo { color: var(--ok); background: var(--ok-soft); border-color: #bbf7d0; }
.selo.st-andamento, .st-andamento > .selo { color: var(--warn); background: var(--warn-soft); border-color: #fde68a; }
.selo.st-planejado, .st-planejado > .selo { color: var(--accent); background: var(--accent-soft); border-color: #bae0f7; }

.lista { list-style: none; }
.lista li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.lista li:first-child { border-top: 0; }

.pergunta { border: 0; padding: 1rem 0; border-top: 1px solid var(--border); min-width: 0; }
.bloco > .pergunta:first-of-type { border-top: 0; padding-top: .25rem; }
/* float tira o legend da borda do fieldset: sem isso ele corta a linha divisória */
legend { float: left; width: 100%; font-weight: 600; padding: 0; margin-bottom: .5rem; }
legend + * { clear: both; }
.pergunta > p { margin-bottom: .5rem; }
.pergunta .opcao + .opcao { margin-top: .4rem; }
.obrig { color: var(--err); }
.opcao { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.resposta { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: .6rem .8rem; }
.acoes { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }

.passos { margin: .75rem 0 1rem 1.25rem; display: grid; gap: .25rem; }
.qr { display: flex; justify-content: center; margin: 1rem 0; }
.qr svg { width: 240px; height: 240px; max-width: 100%; display: block; }
.chave { word-break: break-all; }
details summary { cursor: pointer; color: var(--accent); }

@media (max-width: 520px) {
  .marca span { display: none; }
  .cartao, .bloco { padding: 1.1rem; }
  .marco { flex-direction: column; gap: .5rem; }
}

/* Administração */
.grade-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 1rem; align-items: end; margin-top: 1rem; }
.sub { margin-top: 1.5rem; }
.destaque { border-color: #bae0f7; background: var(--accent-soft); }
.copiar { display: flex; gap: .5rem; margin-top: .75rem; }
.copiar input { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.pessoas li { align-items: flex-start; }
.pessoas .selo { margin-top: .35rem; margin-right: .35rem; }
.acoes-linha { display: flex; gap: 1rem; font-size: .9rem; }
.link.perigo { color: var(--err); }
@media (max-width: 640px) {
  .grade-form { grid-template-columns: 1fr; }
  .copiar { flex-direction: column; }
}

/* Formulários longos */
.parte { margin-top: 2.25rem; padding-bottom: .25rem; border-bottom: 2px solid var(--accent); }
.parte h2 { font-size: 1.3rem; margin-bottom: .15rem; }
.itens { margin: .5rem 0 .75rem 1.25rem; display: grid; gap: .35rem; }
.contagem { font-weight: 600; margin: .5rem 0; }
.acoes.fixas { position: sticky; bottom: 0; background: var(--bg); padding: .75rem 0; border-top: 1px solid var(--border); align-items: center; }
.acoes.fixas #estado p, .acoes.fixas #estado .alerta { margin-top: 0; }
