:root {
  --fundo: #14100d;
  --fundo-2: #1d1814;
  --cartao: #241e19;
  --cartao-2: #2c241e;
  --linha: #3a3029;
  --texto: #f3ece2;
  --suave: #b3a696;
  --apagado: #7c7064;
  --luz: #f5a524;
  --luz-forte: #ffbf47;
  --luz-texto: #1a1208;
  --luz-fundo: #f5a52414;
  --brasa: #ff6b4a;
  --ok: #5fd08a;
  --raio: 16px;
  --titulo: 'Bricolage Grotesque', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--titulo); line-height: 1.1; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--luz); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* botões */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 700;
  background: var(--luz); color: var(--luz-texto); text-decoration: none;
  transition: transform .08s ease, background .15s ease, opacity .15s;
}
.botao:hover { background: var(--luz-forte); }
.botao:active { transform: scale(.97); }
.botao:disabled { opacity: .45; cursor: not-allowed; }
.botao.secundario { background: transparent; color: var(--texto); border: 1px solid var(--linha); }
.botao.secundario:hover { border-color: var(--suave); }
.botao.perigo { background: transparent; color: var(--brasa); border: 1px solid #5a2e24; }
.botao.texto { background: none; color: var(--luz); padding: 10px; }
.botao.pequeno { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.botao.largo { width: 100%; }
.botao.grande { padding: 16px 20px; font-size: 17px; }

/* formulários */
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo label { font-size: 14px; color: var(--suave); font-weight: 600; }
.campo small, .dica { color: var(--apagado); font-size: 13px; }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=number], input[type=url], textarea, select {
  width: 100%; background: var(--fundo-2); border: 1px solid var(--linha); border-radius: 12px;
  padding: 13px 14px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--luz); box-shadow: 0 0 0 3px #f5a5241f; }
textarea { resize: vertical; min-height: 90px; }
.prefixo { display: flex; align-items: center; background: var(--fundo-2); border: 1px solid var(--linha); border-radius: 12px; overflow: hidden; }
.prefixo span { padding: 0 0 0 14px; color: var(--apagado); white-space: nowrap; font-size: 15px; }
.prefixo input { border: 0; background: none; padding-left: 2px; box-shadow: none !important; }
.prefixo:focus-within { border-color: var(--luz); }

.chave { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.chave input { position: absolute; opacity: 0; }
.chave .trilho { width: 48px; height: 28px; border-radius: 99px; background: var(--linha); position: relative; transition: background .15s; flex: none; }
.chave .trilho::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--texto); transition: transform .15s; }
.chave input:checked + .trilho { background: var(--ok); }
.chave input:checked + .trilho::after { transform: translateX(20px); }
.chave input:focus-visible + .trilho { outline: 2px solid var(--luz); outline-offset: 2px; }

.busca input { padding-left: 42px; background: var(--fundo-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23b3a696' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") 14px center no-repeat; }

/* etiquetas de status */
.etiqueta { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--linha); color: var(--suave); white-space: nowrap; }
.etiqueta.pendente { background: #3b2f12; color: var(--luz-forte); }
.etiqueta.aceito { background: #163323; color: var(--ok); }
.etiqueta.tocando { background: var(--brasa); color: #1a0d08; }
.etiqueta.tocado { background: #2a2622; color: var(--suave); }
.etiqueta.recusado { background: #2a1814; color: #d08b7c; }
.etiqueta.pro { background: var(--luz); color: var(--luz-texto); }

.aviso { background: #2a1814; border: 1px solid #5a2e24; color: #f1b6a6; padding: 12px 14px; border-radius: 12px; }
.aviso.amarelo { background: #2b2210; border-color: #5c4615; color: #f3d48f; }
.aviso b { color: var(--texto); }

/* capas e ícones */
.capa {
  width: 64px; height: 64px; border-radius: 12px; flex: none; object-fit: cover;
  background: linear-gradient(135deg, #f5a52455, #ff6b4a44), var(--cartao-2);
  display: grid; place-items: center; font-family: var(--titulo); font-weight: 800; font-size: 22px; color: var(--luz-forte);
}
.icone-nota { width: 46px; height: 46px; border-radius: 12px; background: var(--luz-fundo); color: var(--luz); display: grid; place-items: center; flex: none; }

/* folha (bottom sheet) */
dialog.folha {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 94vh;
  background: var(--fundo-2); color: var(--texto); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px #000a;
}
dialog.folha::backdrop { background: #000b; }
dialog.folha[open] { animation: subir .22s ease; }
@keyframes subir { from { transform: translateY(40px); } }
.folha .dentro { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); }
.folha .puxador { width: 40px; height: 4px; border-radius: 4px; background: var(--linha); margin: -8px auto 16px; }
.folha h3 { font-size: 24px; margin-bottom: 6px; }
.folha .sub { color: var(--suave); margin: 0 0 18px; }
@media (min-width: 600px) { dialog.folha { margin: auto; border-radius: 24px; } }

.passos { display: flex; align-items: center; justify-content: center; gap: 0; margin: 4px 0 20px; }
.passos i { width: 12px; height: 12px; border-radius: 50%; background: var(--linha); }
.passos b { width: 44px; height: 2px; background: var(--linha); }
.passos .feito { background: var(--luz); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 160%);
  background: var(--texto); color: var(--fundo); padding: 12px 18px; border-radius: 12px;
  font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 10px 30px #0008;
  transition: transform .25s ease, visibility 0s .25s; z-index: 80; visibility: hidden;
}
.toast.mostrar { transform: translate(-50%, 0); visibility: visible; transition: transform .25s ease; }
.com-nav .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }

.ondas { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.ondas i { width: 3px; background: currentColor; border-radius: 2px; animation: onda 1s ease-in-out infinite; }
.ondas i:nth-child(2) { animation-delay: .2s; }
.ondas i:nth-child(3) { animation-delay: .4s; }
@keyframes onda { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@media (prefers-reduced-motion: reduce) { .ondas i { animation: none; height: 10px; } }

.vazio { color: var(--apagado); padding: 22px; border: 1px dashed var(--linha); border-radius: var(--raio); text-align: center; }
