/* copypaste — estilos. Sem fontes externas: a CSP não deixa, e não deve. */

:root {
  color-scheme: light dark;
  --fundo: #fbfaf8;
  --papel: #ffffff;
  --tinta: #1b1a17;
  --suave: #5f5c55;
  --linha: #ddd9d1;
  --acento: #1f5f4f;
  --acento-tinta: #ffffff;
  --erro: #a1332a;
  --meu: #eef4f2;
  --dele: #f6f4f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #16151a;
    --papel: #1e1d23;
    --tinta: #ece9e4;
    --suave: #a5a099;
    --linha: #34323a;
    --acento: #6fd3b4;
    --acento-tinta: #10201c;
    --erro: #ef8377;
    --meu: #24312d;
    --dele: #26242c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  max-width: 46rem;
  background: var(--fundo);
  color: var(--tinta);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1 { font-size: 1.1rem; letter-spacing: .02em; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--linha);
  padding-bottom: .7rem;
  margin-bottom: 1.4rem;
}

.estado { margin: 0; color: var(--suave); font-size: .82rem; }
.estado[data-tom="alerta"] { color: var(--erro); }
.estado[data-tom="bom"] { color: var(--acento); }

.intro, .aviso { color: var(--suave); }
.aviso { font-size: .85rem; }
.ou { color: var(--suave); font-size: .85rem; margin: 1.4rem 0 .4rem; }

label { display: block; font-size: .85rem; color: var(--suave); margin-bottom: .3rem; }

.linha { display: flex; gap: .5rem; align-items: stretch; }
.linha input { flex: 1; min-width: 0; }

input, textarea, button {
  font: inherit;
  border-radius: 7px;
  border: 1px solid var(--linha);
  padding: .55rem .7rem;
  background: var(--papel);
  color: var(--tinta);
}

textarea { width: 100%; resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 1px;
}

button { cursor: pointer; border-color: var(--linha); white-space: nowrap; }
button:hover:not(:disabled) { border-color: var(--acento); }
button:disabled { opacity: .5; cursor: not-allowed; }

.primario { background: var(--acento); color: var(--acento-tinta); border-color: var(--acento); font-weight: 600; }
.discreto { background: none; border: none; color: var(--suave); padding: .4rem 0; text-decoration: underline; }

.erro { color: var(--erro); font-size: .88rem; }
.espera { color: var(--suave); font-size: .9rem; }

/* ── Confirmação de fingerprint ────────────────────────────────────────── */

.confirmacao {
  border: 1px solid var(--acento);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.4rem;
}
.confirmacao p { color: var(--suave); font-size: .88rem; }

.fingerprint {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, monospace;
  font-size: 2rem;
  letter-spacing: .32em;
  color: var(--tinta) !important;
  margin: .5rem 0;
  text-align: center;
  /* Selecionável: comparar por voz ou colar num chat é uso legítimo. */
  user-select: text;
}

/* ── Histórico ─────────────────────────────────────────────────────────── */

.historico { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }

.item {
  background: var(--dele);
  border: 1px solid var(--linha);
  border-radius: 9px;
  padding: .6rem .75rem;
}
.item[data-quem="eu"] { background: var(--meu); }

.item header {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  border: none;
  padding: 0;
  margin: 0 0 .35rem;
  font-size: .74rem;
  color: var(--suave);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.item pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13.5px/1.5 ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, monospace;
}

.item button { font-size: .78rem; padding: .2rem .5rem; }

.vazio { color: var(--suave); font-size: .88rem; font-style: italic; }

.envio { display: grid; gap: .5rem; margin-bottom: .8rem; }
.envio button { justify-self: start; }

.oculto {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

footer {
  margin-top: 2.5rem;
  padding-top: .8rem;
  border-top: 1px solid var(--linha);
  font-size: .82rem;
}
footer a { color: var(--suave); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--dele);
  padding: .05em .3em;
  border-radius: 4px;
}

/* ── Itens ricos (passo 6) ─────────────────────────────────────────────── */

.nota { margin: 0 0 .4rem; font-size: .88rem; color: var(--suave); }
.nota.falhou { color: var(--erro); }

progress {
  width: 100%;
  height: 6px;
  border: none;
  border-radius: 99px;
  background: var(--linha);
  accent-color: var(--acento);
}

.corpo { display: grid; gap: .5rem; }

.imagem {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 7px;
  border: 1px solid var(--linha);
  display: block;
  /* Fundo xadrez discreto: PNG com transparência precisa de contraste para
     nao sumir no tema escuro. */
  background: repeating-conic-gradient(var(--linha) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}

.quadro {
  width: 100%;
  height: 22rem;
  border: 1px solid var(--linha);
  border-radius: 7px;
  background: #fff;
}

.codigo {
  width: 100%;
  min-height: 12rem;
  max-height: 26rem;
  font: 13px/1.5 ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, monospace;
  white-space: pre;
  overflow: auto;
}

.generico { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }

.rodape-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .76rem;
  color: var(--suave);
  overflow-wrap: anywhere;
}

.acoes { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.acoes button, .acoes a.secundario {
  font-size: .78rem;
  padding: .2rem .5rem;
  border: 1px solid var(--linha);
  border-radius: 6px;
  background: var(--papel);
  color: var(--tinta);
  text-decoration: none;
  cursor: pointer;
}
.acoes a.secundario:hover, .acoes button:hover { border-color: var(--acento); }

.botoes { display: flex; gap: .5rem; flex-wrap: wrap; }

.dica { font-size: .82rem; color: var(--suave); margin: 0 0 1rem; }
kbd {
  font: inherit;
  font-size: .9em;
  border: 1px solid var(--linha);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 .3em;
  background: var(--papel);
}

body.arrastando { outline: 3px dashed var(--acento); outline-offset: -8px; }

.quadro.alto { height: 32rem; }
.video { width: 100%; max-height: 60vh; border-radius: 7px; background: #000; }
.audio { width: 100%; }
.sem-previa { color: var(--suave); font-size: .84rem; }
.acoes a.destaque {
  background: var(--acento);
  color: var(--acento-tinta);
  border-color: var(--acento);
  font-weight: 600;
}

/* Código da sessão: feito para ser lido de uma tela e digitado noutra. */
.codigo-grande {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, monospace;
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  font-weight: 600;
  letter-spacing: .12em;
  text-align: center;
  margin: 1rem 0;
  padding: .8rem .5rem;
  border: 2px solid var(--acento);
  border-radius: 10px;
  background: var(--papel);
  user-select: all;
  overflow-wrap: anywhere;
}

details { margin: 1rem 0; }
summary { cursor: pointer; color: var(--suave); font-size: .85rem; margin-bottom: .5rem; }
