/* App Video: cores e fontes do marca.md (Gabe Souza) */
@font-face { font-family: "Bricolage"; src: url("fontes/BricolageGrotesque-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --fundo: #EDEFE8; --cartao: #F8F9F5; --texto: #161A12; --apagado: #5C6452;
  --marca: #46552A; --sobre-marca: #F8F9F5; --acento: #F0A23B; --sobre-acento: #1E1606;
  --linha: #DADDD2; --verde-claro: #E1E8CF; --erro: #A93A2A;
  --raio: 18px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #11140E; --cartao: #1A1E16; --texto: #ECEFE4; --apagado: #A3AB96;
    --marca: #B3C77A; --sobre-marca: #11140E; --acento: #F4AE4E;
    --linha: #2A3023; --verde-claro: #2F3A1B; --erro: #F08A78;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 520px; margin: 0 auto; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 12px) 18px calc(env(safe-area-inset-bottom) + 32px);
  display: flex; flex-direction: column; gap: 14px;
}
h1, h2 { font-family: "Bricolage", system-ui, sans-serif; font-weight: 700; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--apagado); font-family: inherit; margin-top: 10px; }
p { margin: 0; }
.apagado { color: var(--apagado); }
.pequeno { font-size: 14px; }
.centro { text-align: center; }

/* topo */
.topo { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.topo h1 { flex: 1; font-size: 26px; overflow: hidden; text-overflow: ellipsis; }
.voltar, .redondo {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--cartao); color: var(--texto);
  font-size: 20px; display: grid; place-items: center; cursor: pointer; flex: none;
}
.redondo { font: 700 15px "Bricolage", system-ui; background: var(--marca); color: var(--sobre-marca); }

/* botoes */
button { font: inherit; }
.botao {
  display: block; width: 100%; min-height: 54px; padding: 14px 20px; border: 0; border-radius: var(--raio);
  background: var(--marca); color: var(--sobre-marca); font-weight: 700; font-size: 17px; cursor: pointer; text-align: center; text-decoration: none;
}
.botao.acento { background: var(--acento); color: var(--sobre-acento); }
.botao.claro { background: var(--cartao); color: var(--texto); border: 1.5px solid var(--linha); }
.botao:disabled { opacity: .45; cursor: default; }
.botao:active:not(:disabled) { transform: scale(.985); }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }
.dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* cartoes */
.cartao { background: var(--cartao); border-radius: var(--raio); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
a.cartao, button.cartao { text-decoration: none; color: inherit; border: 0; text-align: left; cursor: pointer; width: 100%; }
.cartao.chama { box-shadow: inset 0 0 0 2px var(--acento); }
.linha { display: flex; align-items: center; gap: 10px; }
.linha > .cresce { flex: 1; min-width: 0; }
.titulo { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selo { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--verde-claro); color: var(--texto); white-space: nowrap; }
.selo.chama { background: var(--acento); color: var(--sobre-acento); }
.selo.erro { background: transparent; box-shadow: inset 0 0 0 1.5px var(--erro); color: var(--erro); }
.barra { height: 6px; border-radius: 99px; background: var(--linha); overflow: hidden; }
.barra > i { display: block; height: 100%; background: var(--marca); border-radius: 99px; transition: width .4s; }
.aviso { background: var(--verde-claro); border-radius: var(--raio); padding: 12px 16px; font-size: 14px; }
.aviso .botao { margin-top: 10px; }
a:not(.botao):not(.cartao):not(.voltar) { color: inherit; }
code { font: 0.92em ui-monospace, Consolas, monospace; }
.aviso.erro { background: transparent; box-shadow: inset 0 0 0 1.5px var(--erro); color: var(--erro); }

/* formulario */
label.campo { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 15px; }
input[type=text], input[type=url], textarea {
  font: inherit; font-weight: 400; color: var(--texto); background: var(--cartao); border: 1.5px solid var(--linha);
  border-radius: 14px; padding: 13px 14px; width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--marca); }
.escolha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.escolha button {
  min-height: 64px; border-radius: var(--raio); border: 1.5px solid var(--linha); background: var(--cartao); color: var(--texto);
  font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2;
}
.escolha button small { font-weight: 400; color: var(--apagado); }
.escolha button[aria-pressed=true] { background: var(--marca); border-color: var(--marca); color: var(--sobre-marca); }
.escolha button[aria-pressed=true] small { color: inherit; opacity: .8; }
.com-mic { position: relative; }
.com-mic textarea { padding-right: 56px; }
.mic { position: absolute; right: 8px; bottom: 12px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--verde-claro); font-size: 19px; cursor: pointer; }
.mic.ouvindo { background: var(--acento); animation: pulso 1s infinite; }
@keyframes pulso { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .mic.ouvindo { animation: none; } .barra > i { transition: none; } }
.arquivo { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--linha); }
.arquivo:first-child { border-top: 0; }
.x { border: 0; background: none; color: var(--apagado); font-size: 18px; width: 36px; height: 36px; cursor: pointer; flex: none; }

/* conversa */
.conversa { display: flex; flex-direction: column; gap: 8px; }
.fala { max-width: 88%; padding: 10px 14px; border-radius: 18px; background: var(--cartao); white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; border-bottom-left-radius: 6px; }
.fala.minha { align-self: flex-end; background: var(--marca); color: var(--sobre-marca); border-radius: 18px; border-bottom-right-radius: 6px; }
.fala small { display: block; opacity: .65; font-size: 12px; margin-top: 2px; }

video { width: 100%; max-height: 70dvh; border-radius: 14px; background: #000; display: block; }
details { border-top: 1px solid var(--linha); padding-top: 8px; }
summary { cursor: pointer; font-weight: 700; min-height: 32px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.5 ui-monospace, Consolas, monospace; margin: 8px 0 0; }

/* entrar */
.entrar { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; text-align: center; }
.entrar img { width: 84px; height: 84px; margin: 0 auto; border-radius: 22px; }
.entrar h1 { font-size: 40px; }
.rodape { margin-top: auto; padding-top: 18px; text-align: center; }
.rodape button { background: none; border: 0; color: var(--apagado); text-decoration: underline; cursor: pointer; padding: 10px; }
.fixo { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 12px); }
