:root {
  --fundo: #f6f5ef;
  --papel: #ffffff;
  --areia: #ebe8df;
  --linha: #dedacf;
  --tinta: #26221d;
  --cinza: #6b655b;
  --ouro: #b07c3c;
  --ouro-claro: #cd9d51;
  --botao: #bd8a45;
  --serifa: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ouro-fundo: #f3e6d2;
  --verde: #4f7d5c;
  --verde-fundo: #e2efe4;
  --vermelho: #a8402f;
  --raio: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--tinta);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); min-height: 100vh; }
h1 { font-size: 26px; line-height: 1.15; margin: 0 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 28px 0 10px; letter-spacing: -0.01em; }
p { margin: 0 0 10px; }
a { color: inherit; }
.sub { color: var(--cinza); font-size: 14px; }
.carregando { text-align: center; color: var(--cinza); padding: 60px 0; }
.num { font-variant-numeric: tabular-nums; }

/* topo */
.topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 40px; }
.marca { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.marca img { width: 30px; height: 30px; }
.voltar { background: none; border: 0; padding: 8px 8px 8px 0; font: inherit; color: var(--cinza); cursor: pointer; }
.saldo-chip { background: var(--tinta); color: #f3dfb4; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }

/* botões e campos */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 12px 18px; border-radius: 999px; border: 0;
  background: var(--botao); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #ae7d3b; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.escuro { background: var(--tinta); color: #fff; }
.btn.claro { background: transparent; border: 1.5px solid var(--linha); color: var(--tinta); font-weight: 600; }
.btn.perigo { background: transparent; border: 1.5px solid #e0bdb5; color: var(--vermelho); font-weight: 600; }
.btn.peq { width: auto; min-height: 38px; padding: 8px 16px; font-size: 14px; }
.linha-btn { display: flex; gap: 10px; flex-wrap: wrap; }
.linha-btn .btn { flex: 1 1 140px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 16px 0 6px; }
label small { font-weight: 400; color: var(--cinza); }
input, select, textarea {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--linha); border-radius: 12px;
  background: var(--papel); color: var(--tinta); font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--ouro); outline-offset: 2px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--areia); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: none; padding: 10px; border-radius: 999px; font: inherit; font-weight: 600; color: var(--cinza); cursor: pointer; }
.seg button.on { background: var(--papel); color: var(--tinta); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button:disabled { opacity: .5; cursor: default; }

/* cartões e avisos */
.cartao { background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; margin-bottom: 12px; }
.nota { background: var(--ouro-fundo); border-radius: var(--raio); padding: 14px 16px; margin-bottom: 14px; font-size: 15px; }
.nota.verde { background: var(--verde-fundo); }
.nota b { display: block; margin-bottom: 2px; }
.nota .btn { margin-top: 10px; }
.erro { color: var(--vermelho); font-size: 14px; margin-top: 10px; min-height: 20px; }
.selo { display: inline-block; background: var(--verde-fundo); color: var(--verde); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; vertical-align: middle; }
.selo.ouro { background: var(--ouro-fundo); color: #7a5a1c; }
.selo.cinza { background: var(--areia); color: var(--cinza); }
.vazio { text-align: center; color: var(--cinza); padding: 40px 12px; }

/* feed */
.filtros { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 14px; padding: 0 16px 2px; scrollbar-width: none; }
.filtros::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--linha); background: var(--papel); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--tinta); }
.chip.on { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.grade { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 600px) { .grade { grid-template-columns: repeat(3, 1fr); } }
.item { display: block; text-decoration: none; background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; }
.item .foto { aspect-ratio: 1; background: var(--areia) center/cover no-repeat; display: grid; place-items: center; color: var(--cinza); font-size: 13px; text-align: center; padding: 8px; }
.item .txt { padding: 10px 12px 12px; }
.item .tit { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.item .val { color: var(--ouro); font-weight: 800; margin-top: 4px; }
.item .meta { font-size: 12px; color: var(--cinza); margin-top: 2px; }

/* oferta */
.galeria { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px 16px; padding: 0 16px; scrollbar-width: none; }
.galeria::-webkit-scrollbar { display: none; }
.galeria img { flex: none; width: min(86%, 440px); aspect-ratio: 4/3; object-fit: cover; border-radius: var(--raio); scroll-snap-align: center; background: var(--areia); }
.galeria img:only-child { width: 100%; }
.preco { font-size: 30px; font-weight: 800; color: var(--ouro); letter-spacing: -0.02em; margin: 6px 0 2px; }
.dono { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--tinta); color: #f3dfb4; display: grid; place-items: center; font-weight: 700; }
.texto-livre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* fotos no formulário */
.fotos { display: flex; gap: 8px; flex-wrap: wrap; }
.fotos .mini { position: relative; width: 84px; height: 84px; border-radius: 12px; background: var(--areia) center/cover; }
.fotos .mini button { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--tinta); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.fotos .mais { width: 84px; height: 84px; border-radius: 12px; border: 1.5px dashed var(--ouro-claro); background: none; color: var(--ouro); font: inherit; font-size: 13px; cursor: pointer; }

/* listas */
.lista a, .lista .lin { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--linha); text-decoration: none; }
.thumb { flex: none; width: 52px; height: 52px; border-radius: 10px; background: var(--areia) center/cover; }
.lista .meio { flex: 1; min-width: 0; }
.lista .meio b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .meio span { display: block; font-size: 14px; color: var(--cinza); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .fim { flex: none; text-align: right; font-size: 13px; color: var(--cinza); }
.mais { color: var(--verde); font-weight: 700; }
.menos { color: var(--tinta); font-weight: 700; }

/* carteira */
.carteira { background: var(--tinta); color: #fff; border-radius: 20px; padding: 24px 20px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.carteira img { width: 84px; height: 84px; flex: none; }
.carteira .rot { color: #cfc6b4; font-size: 14px; }
.carteira .valor { font-size: 40px; font-weight: 800; color: #f3dfb4; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 10px; }
.carteira .guardado { font-size: 14px; color: #cfc6b4; }

/* chat */
.chat-topo { display: flex; gap: 12px; align-items: center; text-decoration: none; background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); padding: 10px; margin-bottom: 12px; }
.msgs { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 12px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 16px; background: var(--papel); border: 1px solid var(--linha); align-self: flex-start; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.eu { align-self: flex-end; background: var(--ouro-fundo); border-color: #ead8b1; }
.msg.sis { align-self: center; max-width: 94%; background: none; border: 0; color: var(--cinza); font-size: 13px; text-align: center; padding: 2px 8px; }
.escrever { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--fundo); border-top: 1px solid var(--linha); padding: 10px 16px; }
.escrever form { max-width: 688px; margin: 0 auto; display: flex; gap: 8px; }
.escrever input { border-radius: 999px; }
.escrever .btn { width: auto; flex: none; }
.com-chat { padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important; }
.resumo { width: 100%; border-collapse: collapse; margin: 8px 0; }
.resumo td { padding: 5px 0; }
.resumo td:last-child { text-align: right; font-weight: 700; }
.estrelas { display: flex; gap: 6px; margin: 8px 0; }
.estrelas button { border: 0; background: none; font-size: 30px; line-height: 1; cursor: pointer; color: var(--linha); padding: 2px; }
.estrelas button.on { color: var(--ouro-claro); }

/* admin */
.numeros { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.numeros div { background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); padding: 12px 14px; }
.numeros b { display: block; font-size: 22px; }
.numeros span { font-size: 13px; color: var(--cinza); }
code { background: var(--areia); border-radius: 6px; padding: 3px 8px; font-size: 15px; letter-spacing: 0.06em; }

/* barra inferior */
#barra { position: fixed; left: 0; right: 0; bottom: 0; background: var(--papel); border-top: 1px solid var(--linha); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
#barra div { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
#barra a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 2px 8px; font-size: 11px; color: var(--cinza); text-decoration: none; min-height: 64px; justify-content: center; }
#barra a.on { color: var(--tinta); font-weight: 700; }
#barra svg { width: 24px; height: 24px; }
#barra a.novo span.bola { width: 40px; height: 40px; border-radius: 50%; background: var(--botao); color: #fff; display: grid; place-items: center; }

/* modal e toast */
.fundo-modal { position: fixed; inset: 0; background: rgba(31,28,24,.55); display: grid; place-items: end center; z-index: 20; }
.modal { background: var(--fundo); width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
@media (min-width: 600px) { .fundo-modal { place-items: center; } .modal { border-radius: 22px; } }
.pix-falso { border: 1.5px dashed var(--ouro-claro); border-radius: var(--raio); padding: 16px; text-align: center; margin: 14px 0; }
#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 14px; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; font-size: 15px; text-align: center; }
#toast.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* tipografia da marca: títulos em grotesca pesada, texto de apoio em serifa */
.lema, .sub, .nota, .texto-livre, .vazio { font-family: var(--serifa); }
.sub { font-size: 15px; }
.entrada { padding-top: 6vh; }
.entrada .logo { width: 84px; height: 84px; display: block; margin-bottom: 14px; }
.entrada h1 { font-size: 46px; font-weight: 900; letter-spacing: -0.02em; line-height: 1; }
.lema { font-size: 21px; font-weight: 600; line-height: 1.25; margin: 10px 0 6px; }

/* entrar com Google */
.btn.google { background: #fff; color: #1f1f1f; border: 1.5px solid var(--linha); font-weight: 600; }
.btn.google:hover { background: #faf9f5; }
.ou { display: flex; align-items: center; gap: 12px; color: var(--cinza); font-size: 14px; margin: 16px 0; }
.ou::before, .ou::after { content: ""; flex: 1; height: 1px; background: var(--linha); }
