:root {
  --fundo: #f2f4f7;
  --cartao: #ffffff;
  --texto: #1b1f24;
  --suave: #5f6b7a;
  --borda: #d5dbe3;
  --azul: #0f4c81;
  --azul-claro: #e3eef8;
  --vermelho: #c62828;
  --verde: #2e7d32;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #12151a;
    --cartao: #1c2129;
    --texto: #e8ecf1;
    --suave: #9aa6b5;
    --borda: #2f3743;
    --azul: #5aa2e6;
    --azul-claro: #1d3247;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  padding-bottom: env(safe-area-inset-bottom);
}
.topo {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--azul); color: #fff;
}
.topo h1 { margin: 0; font-size: 1.15rem; }
.status { font-size: .8rem; opacity: .95; display: flex; align-items: center; gap: 10px; }
a.link-topo { text-decoration: none; }
.link-topo { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); border-radius: 8px; padding: 4px 10px; font-size: .8rem; }
.tela { padding: 12px 12px 32px; max-width: 640px; margin: 0 auto; }
.cartao {
  background: var(--cartao); border: 1px solid var(--borda); border-radius: 14px;
  padding: 14px; margin-bottom: 12px;
}
h2 { font-size: 1rem; margin: 0 0 10px; }
.dica { color: var(--suave); font-size: .88rem; margin: 0 0 10px; }
label { display: block; font-size: .85rem; color: var(--suave); margin: 10px 0 0; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px;
  font: inherit; color: var(--texto); background: var(--fundo);
  border: 1px solid var(--borda); border-radius: 10px; padding: 11px 12px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azul); border-color: transparent; }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button, .botao-grande {
  font: inherit; border-radius: 12px; cursor: pointer; border: 0;
  -webkit-tap-highlight-color: transparent;
}
.botao-grande {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 12px; margin: 4px 0 10px;
  background: var(--azul-claro); color: var(--azul); font-weight: 600; font-size: 1.05rem;
}
.principal {
  width: 100%; min-height: 52px; background: var(--azul); color: #fff; font-weight: 600; font-size: 1.05rem;
}
.secundario {
  width: 100%; min-height: 44px; margin-top: 8px;
  background: transparent; color: var(--azul); border: 1px solid var(--borda);
}
.enviar { margin-top: 4px; }
.microfone.gravando { background: var(--vermelho); color: #fff; animation: pulso 1.2s infinite; }
@keyframes pulso { 50% { opacity: .75; } }
.previa { display: block; width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; margin-bottom: 8px; background: #000; }
details summary { cursor: pointer; color: var(--suave); font-size: .9rem; padding: 4px 0; }
.opcoes { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--borda); border-radius: 10px; overflow: hidden; }
.opcoes li { padding: 12px; border-top: 1px solid var(--borda); cursor: pointer; }
.opcoes li:first-child { border-top: 0; }
.opcoes li small { display: block; color: var(--suave); }
.opcoes li.vazio { color: var(--suave); cursor: default; }
.escolhido { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--azul-claro); color: var(--azul); font-weight: 600; }
.miniaturas { display: flex; flex-wrap: wrap; gap: 8px; }
.miniaturas figure { position: relative; margin: 0; }
.miniaturas img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.miniaturas button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--vermelho); color: #fff; font-size: .8rem; }
.erro { color: var(--vermelho); }
.ok { color: var(--verde); font-weight: 600; }
.carregando {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: rgba(0, 0, 0, .45); color: #fff; font-weight: 600;
}
.carregando span { background: rgba(0, 0, 0, .7); padding: 14px 20px; border-radius: 12px; }
pre { white-space: pre-wrap; word-break: break-word; font-size: .8rem; background: var(--fundo); padding: 10px; border-radius: 8px; }
[hidden] { display: none !important; }
