:root {
  --fundo: #f6f4ef;
  --superficie: #ffffff;
  --tinta: #1b1b1a;
  --suave: #67635c;
  --linha: #e3dfd6;
  --marca: #1f6f5c;
  --marca-forte: #175446;
  --marca-texto: #ffffff;
  --aviso: #9a6412;
  --aviso-fundo: #fbf0dc;
  --ok: #276b43;
  --ok-fundo: #e3f1e7;
  --info: #25609e;
  --info-fundo: #e3edf8;
  --perigo: #b3261e;
  --sombra: 0 1px 2px rgba(0, 0, 0, .05), 0 2px 8px rgba(0, 0, 0, .04);
  --raio: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fundo: #131312;
    --superficie: #1d1d1b;
    --tinta: #f0eee8;
    --suave: #a29e96;
    --linha: #2e2d2a;
    --marca: #4fb39a;
    --marca-forte: #6cc7b0;
    --marca-texto: #0d1f1a;
    --aviso: #f0b85a;
    --aviso-fundo: #3a2d14;
    --ok: #74c794;
    --ok-fundo: #173222;
    --info: #86b6ec;
    --info-fundo: #17283d;
    --perigo: #ff8a80;
    --sombra: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --fundo: #131312;
  --superficie: #1d1d1b;
  --tinta: #f0eee8;
  --suave: #a29e96;
  --linha: #2e2d2a;
  --marca: #4fb39a;
  --marca-forte: #6cc7b0;
  --marca-texto: #0d1f1a;
  --aviso: #f0b85a;
  --aviso-fundo: #3a2d14;
  --ok: #74c794;
  --ok-fundo: #173222;
  --info: #86b6ec;
  --info-fundo: #17283d;
  --perigo: #ff8a80;
  --sombra: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--tinta);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
img { max-width: 100%; display: block; }
a { color: var(--marca); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: .2rem 0 .4rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
p { margin: .4rem 0; }
.suave { color: var(--suave); }
.dica { color: var(--suave); font-size: .875rem; }
.erro-texto { color: var(--perigo); }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Estrutura */
.topo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; max-width: 1040px; margin: 0 auto;
}
.marca {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: Oswald, Inter, sans-serif; font-weight: 700; font-size: 1.25rem;
  text-transform: uppercase; letter-spacing: .02em; color: var(--tinta); text-decoration: none;
}
.marca-grande { font-size: 1.6rem; margin-bottom: 8px; }
.marca-ponto { width: 12px; height: 12px; border-radius: 50%; background: var(--marca); box-shadow: 0 0 0 4px color-mix(in srgb, var(--marca) 22%, transparent); }
.topo-negocio { color: var(--suave); font-size: .9rem; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conteudo { max-width: 1040px; margin: 0 auto; padding: 4px 16px 110px; }

.abas {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--superficie); border-top: 1px solid var(--linha);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.abas a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--suave); text-decoration: none; font-size: .7rem; padding: 4px 0; border-radius: 10px;
}
.abas svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.abas a.ativa { color: var(--marca); font-weight: 600; }

@media (min-width: 760px) {
  .abas {
    position: static; display: flex; gap: 4px; justify-content: flex-start;
    max-width: 1040px; margin: 0 auto 12px; padding: 0 16px; border: 0; background: none;
  }
  .abas a { flex-direction: row; gap: 8px; font-size: .95rem; padding: 8px 14px; }
  .abas svg { width: 18px; height: 18px; }
  .abas a.ativa { background: color-mix(in srgb, var(--marca) 12%, transparent); }
  .conteudo { padding-bottom: 48px; }
}

.faixa-demo, .faixa-alerta { text-align: center; font-size: .85rem; padding: 8px 16px; }
.faixa-demo { background: var(--info-fundo); color: var(--info); }
.faixa-alerta { background: var(--aviso-fundo); color: var(--aviso); max-width: 1040px; margin: 0 auto 12px; border-radius: 10px; }

/* Blocos */
.cartao {
  background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio);
  padding: 18px; margin: 14px 0; box-shadow: var(--sombra);
}
.cartao.destaque { border-color: color-mix(in srgb, var(--marca) 40%, var(--linha)); }
.secao { margin: 26px 0 10px; font-size: 1rem; color: var(--suave); text-transform: uppercase; letter-spacing: .06em; }
.linha-botoes { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.titulo-linha { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }

.resumo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.resumo div { background: var(--superficie); border: 1px solid var(--linha); border-radius: 12px; padding: 12px; }
.resumo strong { display: block; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.resumo span { font-size: .8rem; color: var(--suave); }
.relatorio .resumo div { background: var(--fundo); }

/* Botões e campos */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--linha); background: var(--superficie); color: var(--tinta);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--suave); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-cheio { background: var(--marca); border-color: var(--marca); color: var(--marca-texto); }
.btn-cheio:hover { background: var(--marca-forte); border-color: var(--marca-forte); }
.btn-perigo { background: var(--perigo); border-color: var(--perigo); color: #fff; }
.btn-pequeno { min-height: 40px; min-width: 40px; padding: 6px 12px; }
.link { background: none; border: 0; padding: 8px 0; color: var(--marca); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--marca) 60%, transparent); outline-offset: 2px; }

.campo { margin: 12px 0; }
.campo label, .rotulo { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), textarea, select {
  width: 100%; font: inherit; color: var(--tinta); background: var(--fundo);
  border: 1px solid var(--linha); border-radius: 10px; padding: 11px 12px;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--marca); outline-offset: 0; border-color: var(--marca); }
.marcar { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; cursor: pointer; }
.marcar input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--marca); flex: none; }
.arquivo {
  display: flex; align-items: center; justify-content: center; min-height: 64px; margin: 12px 0;
  border: 2px dashed var(--linha); border-radius: 12px; color: var(--marca); font-weight: 600; cursor: pointer; text-align: center; padding: 12px;
}
.arquivo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.arquivo:focus-within { border-color: var(--marca); }
fieldset { border: 0; padding: 0; margin: 12px 0; }
legend { font-weight: 600; margin-bottom: 4px; }

/* Selos */
.selo { display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.selo-aviso { background: var(--aviso-fundo); color: var(--aviso); }
.selo-ok { background: var(--ok-fundo); color: var(--ok); }
.selo-info { background: var(--info-fundo); color: var(--info); }
.selo-neutro { background: var(--linha); color: var(--suave); }


/* Calendário */
.calendario { padding: 12px; }
.semana, .grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.semana span { text-align: center; font-size: .75rem; font-weight: 600; color: var(--suave); padding-bottom: 4px; }
.dia { position: relative; aspect-ratio: 1; border-radius: 8px; background: var(--fundo); overflow: hidden; }
.dia.vazio { background: none; }
.dia .num { position: absolute; top: 3px; left: 5px; font-size: .72rem; color: var(--suave); z-index: 1; }
.dia.com-post { outline: 2px solid var(--linha); outline-offset: -2px; }
.dia.com-post img { width: 100%; height: 100%; object-fit: cover; }
.dia.com-post .num { color: #fff; background: rgba(0, 0, 0, .55); border-radius: 6px; padding: 0 5px; }
.dia.com-post::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; }
.st-aguardando_aprovacao::after { background: var(--aviso); }
.st-aprovado::after, .st-publicado::after { background: var(--ok); }
.st-ajuste_pedido::after { background: var(--info); }
.st-aguardando_aprovacao { outline-color: var(--aviso) !important; }
.legenda-cal { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .78rem; color: var(--suave); }
.legenda-cal span { display: inline-flex; align-items: center; gap: 6px; }
.bola { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.bola.aviso { background: var(--aviso); }
.bola.ok { background: var(--ok); }
.bola.info { background: var(--info); }
@media (min-width: 760px) { .semana, .grade { gap: 8px; } .dia .num { font-size: .8rem; } }

/* Lista */
.lista-posts { display: grid; gap: 8px; }
@media (min-width: 760px) { .lista-posts { grid-template-columns: 1fr 1fr; } }
.item-post {
  display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px;
  background: var(--superficie); border: 1px solid var(--linha); color: var(--tinta); text-decoration: none;
}
.item-post:hover { border-color: var(--suave); }
.mini { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--fundo); flex: none; }
.mini-vertical { height: 80px; }
.item-texto { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.item-texto strong { font-size: .95rem; }
.item-data { font-size: .8rem; color: var(--suave); }

/* Post */
.navegacao-post { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.navegacao-post div { display: flex; gap: 6px; }
.post { display: grid; gap: 18px; }
@media (min-width: 860px) { .post { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); align-items: start; } .arte { position: sticky; top: 16px; } }
.arte { margin: 0; border-radius: var(--raio); overflow: hidden; background: var(--superficie); border: 1px solid var(--linha); }
.arte img { width: 100%; height: auto; }
.sem-arte { display: grid; place-items: center; aspect-ratio: 1; color: var(--suave); font-size: .85rem; }
.post-cabeca { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.legenda {
  white-space: pre-line; background: var(--superficie); border: 1px solid var(--linha);
  border-radius: 12px; padding: 14px; margin-top: 12px; overflow-wrap: anywhere;
}
.hashtags { color: var(--info); font-size: .9rem; margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { font: inherit; font-size: .85rem; padding: 7px 12px; min-height: 36px; border-radius: 999px; border: 1px solid var(--linha); background: var(--fundo); color: var(--tinta); cursor: pointer; }
.chip:hover { border-color: var(--marca); }
.info-cartao { display: flex; gap: 14px; align-items: center; background: var(--info-fundo); border-color: transparent; color: var(--info); }
.info-cartao p { margin: 0; }
.historico .ajuste { border-left: 3px solid var(--linha); padding: 4px 0 4px 12px; margin: 10px 0; }

/* Fotos */
.dicas { margin: 6px 0; padding-left: 20px; color: var(--suave); font-size: .9rem; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.galeria figure { margin: 0; }
.galeria img, .galeria .sem-arte { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--linha); }
.galeria figcaption { font-size: .75rem; color: var(--suave); margin-top: 3px; }
.recusada { display: flex; gap: 12px; align-items: center; margin: 10px 0; }
.recusada img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; }

/* Meu negócio */
.linhas { display: grid; gap: 8px; }
.linha-edit { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--linha); }
.linha-edit .largo { grid-column: 1 / 3; }
.linha-edit button { grid-column: 3; grid-row: 1; }
@media (min-width: 640px) {
  .linha-edit { display: flex; border: 0; padding: 0; }
  .linha-edit .largo { flex: 3; } .linha-edit .medio { flex: 2; } .linha-edit .curto { flex: 1.2; }
}
.logo-previa { width: 96px; height: 96px; border-radius: 12px; border: 1px solid var(--linha); display: grid; place-items: center; overflow: hidden; background: var(--fundo); font-size: .8rem; }
.logo-previa img { max-height: 100%; object-fit: contain; }
.cores { display: flex; gap: 18px; }
.cores label { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .85rem; }
.cores input { width: 56px; height: 44px; border: 1px solid var(--linha); border-radius: 10px; background: none; padding: 2px; }
.barra-salvar { position: sticky; bottom: 76px; padding: 10px 0; }
.barra-salvar .btn { width: calc(100% - 60px); box-shadow: 0 6px 18px rgba(0, 0, 0, .15); }
@media (min-width: 760px) { .barra-salvar { bottom: 12px; } .barra-salvar .btn { width: auto; } }

/* Conta */
.dados { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.dados dt { color: var(--suave); }
.dados dd { margin: 0; overflow-wrap: anywhere; }
.cancelar summary { cursor: pointer; font-weight: 600; color: var(--perigo); }
.pedidos { padding-left: 20px; }

/* Entrar */
.tela-entrar { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.entrar { width: 100%; max-width: 420px; }
.entrar .btn-cheio { width: 100%; margin-top: 6px; }

/* Avisos e carregamento */
.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--tinta); color: var(--fundo); font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  transition: opacity .4s;
}
.toast-erro { background: var(--perigo); color: #fff; }
.toast.sai { opacity: 0; }
@media (min-width: 760px) { .toast { bottom: 24px; } }
.carregando { min-height: 60vh; display: grid; place-items: center; }
.giro { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--linha); border-top-color: var(--marca); animation: gira 0.8s linear infinite; flex: none; }
.giro.pequeno { width: 22px; height: 22px; border-color: color-mix(in srgb, var(--info) 30%, transparent); border-top-color: var(--info); }
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .giro { animation-duration: 3s; } .toast { transition: none; } }

/* Apagar foto e navegação de meses */
.galeria figure { position: relative; }
.apagar-foto {
  position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.apagar-foto:hover { background: var(--perigo); }
.recusada p { flex: 1; }
.navega-mes { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 360px; margin: 4px 0 8px; }
.navega-mes span { font-weight: 600; }
.desligado { opacity: .3; cursor: default; pointer-events: none; }

/* Botão do WhatsApp: só o logo */
.whats {
  position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 20;
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%; background: #25d366; color: #fff; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.whats:hover { background: #1ebe5a; }
.whats svg { width: 26px; height: 26px; fill: currentColor; stroke: none; }
@media (min-width: 760px) { .whats { bottom: 24px; right: 24px; } }

/* Formulário de entrada */
.entrada { max-width: 680px; }
.progresso { height: 8px; border-radius: 999px; background: var(--linha); overflow: hidden; margin-top: 8px; }
.progresso span { display: block; height: 100%; background: var(--marca); border-radius: 999px; transition: width .3s; }
.navegar-entrada { flex-wrap: nowrap; justify-content: space-between; position: sticky; bottom: 0; background: var(--fundo); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); margin-top: 18px; }
.navegar-entrada .btn-cheio { margin-left: auto; }

/* Pesquisa de satisfação */
.pesquisa h2 { font-size: 1.05rem; }
.notas { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; margin: 12px 0 4px; }
.nota { min-height: 40px; padding: 0; border-radius: 8px; border: 1px solid var(--linha); background: var(--fundo); color: var(--tinta); font: inherit; font-weight: 600; cursor: pointer; }
.nota.escolhida { background: var(--marca); border-color: var(--marca); color: var(--marca-texto); }
.notas-legenda { display: flex; justify-content: space-between; font-size: .78rem; color: var(--suave); margin-bottom: 10px; }

/* Demonstração: ações travadas ficam apagadas */
body.demo button:not([data-livre]):not(.whats),
body.demo input, body.demo textarea, body.demo select { cursor: not-allowed; }
body.demo button:not([data-livre]):not(.whats) { opacity: .55; }

/* Respostas prontas do WhatsApp */
.resposta { border-top: 1px solid var(--linha); padding-top: 14px; margin-top: 14px; }
.resposta h3 { font-size: .95rem; margin: 0 0 6px; }
.resposta-texto { white-space: pre-wrap; background: var(--fundo); border-radius: 10px; padding: 12px 14px; margin: 0 0 8px; font-size: .92rem; overflow-wrap: anywhere; }
.lista-destaques { margin: 0; padding-left: 20px; }
.lista-destaques li { margin-bottom: 4px; }
