:root {
  --fundo: #0A1F1E;
  --fundo-2: #123534;
  --texto: #E9F4F2;
  --accent: #46E0C8;
  --secundario: #9CB9B5;
  --borda: #1E4A47;
  --perigo: #FF8A7A;
  --ok: #46E0C8;
  --aviso: #FFD37A;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--fundo);
  color: var(--texto);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

#app { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; }
#app > * { order: 5; }
#app > .topo { order: 0; }
#app > .rodape { order: 99; }

.rodape { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--borda); }
.rodape-acoes { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rodape a { color: var(--secundario); font-size: 0.85rem; }
.rodape button { font-size: 0.85rem; padding: 6px 10px; }
.rodape .botao-enviar-parte {
  width: 100%; margin-top: 12px; padding: 12px; font-size: 0.95rem;
  border-color: var(--accent); color: var(--accent);
}
.voltar-inicio { color: var(--secundario); }

.etiqueta-sync {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 2px 8px; white-space: nowrap;
}

details summary::-webkit-details-marker { color: var(--secundario); }
details[open] summary { margin-bottom: 6px; }
.ok-ia input[type="text"] { background: rgba(0,0,0,.25); }

h1 { font-size: 1.35rem; line-height: 1.3; }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; color: var(--secundario); font-weight: 600; }

.topo {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 0 16px;
}
.topo .marca { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }

.badge-papel {
  font-size: 0.8rem; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--borda); background: var(--fundo-2); color: var(--texto);
  cursor: pointer;
}
.badge-papel .quem { color: var(--accent); font-weight: 600; }

.cartao {
  background: var(--fundo-2); border: 1px solid var(--borda);
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
}

.suave { color: var(--secundario); font-size: 0.9rem; }
.mini { font-size: 0.8rem; color: var(--secundario); }

button, .botao {
  appearance: none; border: 1px solid var(--borda); border-radius: 12px;
  background: var(--fundo-2); color: var(--texto);
  font-size: 1rem; padding: 12px 16px; cursor: pointer; font-family: inherit;
  transition: filter 0.15s;
}
button:active { filter: brightness(1.2); }
button:disabled { opacity: 0.45; cursor: default; }

.botao-primario {
  background: var(--accent); color: #06302B; border-color: var(--accent); font-weight: 700;
}
.botao-perigo { border-color: var(--perigo); color: var(--perigo); background: transparent; }
.botao-fantasminha { background: transparent; border-color: transparent; color: var(--secundario); font-size: 0.9rem; }
.botao-largo { width: 100%; display: block; text-align: center; }

.linha-botoes { display: flex; gap: 10px; margin-top: 12px; }
.linha-botoes > * { flex: 1; }

input[type="text"], textarea, select {
  width: 100%; background: var(--fundo); color: var(--texto);
  border: 1px solid var(--borda); border-radius: 10px;
  padding: 12px; font-size: 1rem; font-family: inherit;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

label { display: block; margin: 14px 0 6px; font-size: 0.9rem; color: var(--secundario); }

/* barra de progresso */
.progresso { margin: 8px 0 16px; }
.progresso .trilho { height: 8px; border-radius: 999px; background: var(--fundo-2); border: 1px solid var(--borda); overflow: hidden; }
.progresso .cheio { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s; }
.progresso .texto { font-size: 0.8rem; color: var(--secundario); margin-top: 4px; }

/* chips de slots */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  font-size: 0.8rem; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--borda); color: var(--secundario); background: transparent; cursor: pointer;
}
.chip.feito { border-color: var(--ok); color: var(--ok); }
.chip.inexistente { text-decoration: line-through; opacity: 0.55; }
.chip.atual { background: var(--accent); color: #06302B; border-color: var(--accent); font-weight: 700; }
.chip.contestado { border-color: var(--perigo); color: var(--perigo); }

/* opções de estado (enum) */
.opcoes-estado { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.opcao-estado {
  border: 1px solid var(--borda); border-radius: 10px; padding: 10px;
  text-align: center; cursor: pointer; font-size: 0.95rem; background: var(--fundo);
}
.opcao-estado.ativa { border-color: var(--accent); color: var(--accent); font-weight: 700; }

.foto-preview { width: 100%; border-radius: 12px; border: 1px solid var(--borda); display: block; }
.par-fotos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.par-fotos figure { margin: 0; }
.par-fotos img { width: 100%; border-radius: 10px; border: 1px solid var(--borda); display: block; }
.par-fotos figcaption { font-size: 0.75rem; color: var(--secundario); text-align: center; margin-top: 4px; }

.aviso-ia {
  border: 1px solid var(--aviso); border-radius: 10px; padding: 10px 12px;
  color: var(--aviso); font-size: 0.9rem; margin-top: 10px;
}
.erro-ia {
  border: 1px solid var(--perigo); border-radius: 10px; padding: 10px 12px;
  color: var(--perigo); font-size: 0.9rem; margin-top: 10px;
}
.ok-ia {
  border: 1px solid var(--ok); border-radius: 10px; padding: 10px 12px;
  color: var(--ok); font-size: 0.9rem; margin-top: 10px;
}

/* pensando… */
.pensando { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--secundario); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--borda); border-top-color: var(--accent);
  animation: girar 0.8s linear infinite; flex-shrink: 0;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* tela de passagem de aparelho */
.passe-aparelho { text-align: center; padding: 48px 16px; }
.passe-aparelho .emoji { font-size: 3rem; }

/* câmera */
.palco-camera {
  position: relative; width: 100%; aspect-ratio: 3 / 4;
  background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--borda);
}
.palco-camera video, .palco-camera .fantasma, .palco-camera img.congelado {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.palco-camera .fantasma { pointer-events: none; }
.semaforo {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  font-size: 0.78rem; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,0.55);
}
.semaforo.ok { color: var(--ok); }
.semaforo.ruim { color: var(--perigo); }
.controle-fantasma {
  position: absolute; bottom: 10px; left: 10px; right: 10px; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.55); border-radius: 10px; padding: 8px 12px; font-size: 0.8rem;
}
.controle-fantasma input[type="range"] { flex: 1; }
.debug-qualidade {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  font-family: monospace; font-size: 0.7rem; background: rgba(0,0,0,0.65);
  padding: 4px 8px; border-radius: 8px; color: var(--aviso);
}

/* galeria de fotos do item em captura */
.tiras { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 2px; }
.tira { margin: 0; position: relative; flex: 0 0 96px; }
.tira img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--borda); display: block; }
.tira figcaption { font-size: 0.68rem; color: var(--secundario); margin-top: 3px; text-align: center; line-height: 1.2; }
.tira .remover {
  position: absolute; top: 2px; right: 2px; padding: 0; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(0,0,0,.65); color: var(--texto); font-size: 0.75rem; line-height: 1;
}

.conta-fotos { opacity: 0.7; font-size: 0.72rem; }

.adicionar-item { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.adicionar-item select { flex: 1; }
.adicionar-item .botao-mais-um { white-space: nowrap; font-size: 0.85rem; }

.lista-diferencas { margin: 10px 0 0; padding-left: 18px; }
.lista-diferencas li { margin-bottom: 6px; font-size: 0.92rem; }
.lista-diferencas .fraca { opacity: 0.5; }
.conf { font-size: 0.75rem; color: var(--secundario); }

.selo-nao-exigivel {
  display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--aviso); border: 1px solid var(--aviso); border-radius: 6px; padding: 2px 8px;
}

hr.sep { border: none; border-top: 1px solid var(--borda); margin: 16px 0; }
