:root {
  --fundo: #f6f4ef;
  --papel: #ffffff;
  --tinta: #1d2626;
  --suave: #5b6767;
  --linha: #dcd8cf;
  --marca: #1f5f5b;
  --marca-escura: #164845;
  --marca-clara: #e3efed;
  --perigo: #a3342b;
  --perigo-claro: #f8e5e2;
  --alerta: #8a5a00;
  --alerta-claro: #fff4d6;
  --ok: #2c6e3a;
  --ok-claro: #e3f2e5;
  --raio: 10px;
  font-size: 17px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--tinta);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
}
a { color: var(--marca); }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; }
h2 { font-size: 1.2rem; margin: 1.4rem 0 .5rem; }
p { margin: .4rem 0; }
.suave { color: var(--suave); }
.pequeno { font-size: .88rem; }

.topo {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1.2rem; background: var(--marca); color: #fff;
}
.marca { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.marca span { font-weight: 400; opacity: .85; }
#menu { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
#menu a, #menu button {
  color: #fff; text-decoration: none; background: transparent; border: 0; font: inherit;
  padding: .35rem .7rem; border-radius: 6px; cursor: pointer;
}
#menu a:hover, #menu button:hover, #menu a.ativo { background: rgba(255,255,255,.16); }
#menu .quem { opacity: .8; font-size: .9rem; padding: 0 .5rem; }

main { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.2rem 4rem; }
.estreito { max-width: 560px; margin: 0 auto; }
.cartao {
  background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio);
  padding: 1.3rem 1.4rem; margin: 0 0 1rem;
}
.carregando { color: var(--suave); }

label { display: block; font-weight: 600; margin: .9rem 0 .3rem; }
input[type=text], input[type=password], input[type=search], input:not([type]), textarea, select {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid #bfbab0; border-radius: 8px; background: #fff; color: var(--tinta);
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #8cc2bc; outline-offset: 1px; }
.codigo { letter-spacing: .3em; font-size: 1.3rem; max-width: 12rem; text-align: center; }

button, .botao {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; padding: .6rem 1.1rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--marca); background: var(--marca); color: #fff; text-decoration: none;
}
button:hover, .botao:hover { background: var(--marca-escura); }
button.secundario, .botao.secundario { background: #fff; color: var(--marca); }
button.secundario:hover { background: var(--marca-clara); }
button.perigo { background: #fff; color: var(--perigo); border-color: var(--perigo); }
button.perigo:hover { background: var(--perigo-claro); }
button.grande { font-size: 1.2rem; padding: .9rem 1.6rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
.acoes { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.acoes.direita { justify-content: flex-end; }

.erro { background: var(--perigo-claro); color: var(--perigo); border-radius: 8px; padding: .6rem .8rem; margin: .8rem 0; }
.alerta { background: var(--alerta-claro); color: var(--alerta); border-radius: 8px; padding: .7rem .9rem; margin: .8rem 0; }
.alerta ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.sucesso { background: var(--ok-claro); color: var(--ok); border-radius: 8px; padding: .7rem .9rem; margin: .8rem 0; }

/* lista de consultas */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li a {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: .8rem .4rem; border-bottom: 1px solid var(--linha); color: inherit; text-decoration: none;
}
.lista li a:hover { background: var(--marca-clara); }
.etiqueta { font-size: .8rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; white-space: nowrap; background: #ecebe6; color: var(--suave); }
.etiqueta.aprovada { background: var(--ok-claro); color: var(--ok); }
.etiqueta.rascunho { background: var(--alerta-claro); color: var(--alerta); }
.etiqueta.gravando { background: var(--perigo-claro); color: var(--perigo); }
.linha-busca { display: flex; gap: .6rem; }

/* consentimento */
.texto-consentimento { background: var(--marca-clara); border-radius: 8px; padding: 1rem 1.1rem; font-size: 1.05rem; }
.opcoes { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.opcoes label { font-weight: 400; display: flex; gap: .4rem; align-items: center; margin: .3rem 0; }

/* gravação */
.gravador { text-align: center; padding: 2rem 1rem; }
.relogio { font-size: 3.4rem; font-variant-numeric: tabular-nums; font-weight: 700; margin: .4rem 0; }
.estado-grav { font-weight: 700; color: var(--perigo); }
.estado-grav.pausado { color: var(--alerta); }
.ponto { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; background: var(--perigo); margin-right: .4rem; animation: piscar 1.2s infinite; }
.pausado .ponto { animation: none; background: var(--alerta); }
@keyframes piscar { 50% { opacity: .25; } }
.medidor { height: 12px; max-width: 420px; margin: 1rem auto; background: #e8e5de; border-radius: 99px; overflow: hidden; }
.medidor div { height: 100%; width: 0; background: var(--marca); transition: width .1s; }
.gravador .acoes { justify-content: center; }

.barra { height: 14px; background: #e8e5de; border-radius: 99px; overflow: hidden; margin: .8rem 0; }
.barra div { height: 100%; background: var(--marca); transition: width .4s; }

/* revisão */
.revisao { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.2rem; align-items: start; }
.secao { margin-bottom: 1.1rem; }
.secao-topo { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.secao-topo h3 { margin: 0; font-size: 1rem; letter-spacing: .03em; }
.secao textarea { min-height: 5rem; margin-top: .3rem; font-family: inherit; }
.secao.receitas textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; }
.secao .lido { white-space: pre-wrap; background: #faf9f6; border: 1px solid var(--linha); border-radius: 8px; padding: .6rem .7rem; margin-top: .3rem; }
.secao.receitas .lido { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; }
button.copiar { padding: .25rem .7rem; font-size: .85rem; }
.transcricao { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.transcricao pre { white-space: pre-wrap; font-family: inherit; font-size: .93rem; margin: 0; }
.trechos { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 1rem; }
.trechos audio { height: 32px; max-width: 100%; }
.salvo { font-size: .85rem; color: var(--suave); }
.barra-acoes {
  position: sticky; bottom: 0; background: var(--fundo); padding: .8rem 0; border-top: 1px solid var(--linha);
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
}

/* convite */
.qr { display: block; margin: .8rem auto; width: 240px; height: 240px; image-rendering: pixelated; }
.segredo { font-family: ui-monospace, Menlo, monospace; word-break: break-all; background: #f0eee8; padding: .3rem .5rem; border-radius: 6px; }
ol.passos li { margin: .4rem 0; }

#aviso {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  background: var(--tinta); color: #fff; padding: .6rem 1.1rem; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; max-width: 90vw;
}
#aviso.visivel { opacity: 1; }

/* impressão */
.folha { background: #fff; max-width: 820px; margin: 0 auto; padding: 2rem 2.2rem; border: 1px solid var(--linha); }
.folha .cabecalho { border-bottom: 2px solid var(--tinta); padding-bottom: .6rem; margin-bottom: 1rem; }
.folha .cabecalho strong { font-size: 1.25rem; }
.folha h3 { font-size: 1rem; margin: 1.1rem 0 .3rem; letter-spacing: .04em; }
.folha .corpo { white-space: pre-wrap; }
.folha .receitas .corpo { font-family: ui-monospace, Menlo, Consolas, monospace; }
.folha .rodape { margin-top: 2.5rem; font-size: .85rem; color: var(--suave); }
.escolha-secoes { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.escolha-secoes label { font-weight: 400; display: flex; gap: .35rem; align-items: center; margin: .2rem 0; }

@media (max-width: 860px) {
  .revisao { grid-template-columns: 1fr; }
  .transcricao { position: static; max-height: 22rem; }
  .relogio { font-size: 2.6rem; }
  .linha-busca { flex-direction: column; }
}

@media print {
  .nao-imprimir, #aviso { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .folha { border: 0; padding: 0; max-width: none; }
  .folha .oculta { display: none; }
  @page { margin: 18mm 16mm; }
}
