:root {
  --fundo: var(--tg-theme-bg-color, #ffffff);
  --fundo2: var(--tg-theme-secondary-bg-color, #f3f1ee);
  --texto: var(--tg-theme-text-color, #1d1b19);
  --texto2: var(--tg-theme-hint-color, #8a847d);
  --link: var(--tg-theme-link-color, #d9622b);
  --marca: #d9622b;
  --marca-clara: rgba(217, 98, 43, .12);
  --verde: #1fa855;
  --zap: #25d366;
  --alerta: #c98a00;
  --erro: #d93025;
  --borda: rgba(128, 120, 110, .18);
  --raio: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--fundo2); color: var(--texto);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#app { max-width: 560px; margin: 0 auto; padding: 14px 14px 110px; min-height: 100vh; }
.escondido { display: none !important; }
h1 { font-size: 24px; margin: 4px 0 6px; line-height: 1.2; }
h2 { font-size: 19px; margin: 18px 0 8px; }
h3 { font-size: 16px; margin: 0 0 4px; }
p { margin: 6px 0; }
.dica { color: var(--texto2); font-size: 14px; }
.pequeno { font-size: 13px; }
a { color: var(--link); }

/* ---------- blocos */
.cartao { background: var(--fundo); border-radius: var(--raio); padding: 14px; margin: 10px 0; }
.cartao.destaque { background: var(--marca-clara); }
.linha { display: flex; align-items: center; gap: 12px; }
.linha .cresce { flex: 1; min-width: 0; }
.entre { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lista-toque > * { cursor: pointer; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--fundo);
  border-bottom: 1px solid var(--borda); cursor: pointer; }
.item:first-child { border-radius: var(--raio) var(--raio) 0 0; }
.item:last-child { border-radius: 0 0 var(--raio) var(--raio); border-bottom: 0; }
.item:only-child { border-radius: var(--raio); }
.item .icone { font-size: 24px; width: 32px; text-align: center; }
.item .seta { color: var(--texto2); }

/* ---------- topo da home */
.topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.marca { font-weight: 800; font-size: 22px; }
.chip-bairro { background: var(--fundo); border-radius: 20px; padding: 6px 12px; font-size: 14px; cursor: pointer;
  max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.busca { width: 100%; padding: 14px 16px; border-radius: var(--raio); border: 0; background: var(--fundo);
  font-size: 16px; color: var(--texto); outline: none; margin: 8px 0; }
.busca::placeholder { color: var(--texto2); }

/* ---------- grade de áreas */
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.area { background: var(--fundo); border-radius: var(--raio); padding: 16px 12px; cursor: pointer; min-height: 104px;
  display: flex; flex-direction: column; justify-content: space-between; }
.area .icone { font-size: 32px; }
.area .nome { font-weight: 700; font-size: 15px; line-height: 1.2; }
.area .qtd { color: var(--texto2); font-size: 12px; }
.area:active, .item:active, .card-prestador:active { opacity: .7; }

/* ---------- prestadores */
.card-prestador { display: flex; gap: 12px; background: var(--fundo); border-radius: var(--raio); padding: 12px;
  margin: 10px 0; cursor: pointer; align-items: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--marca-clara);
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--marca); font-size: 22px; flex-shrink: 0; }
.avatar.grande { width: 112px; height: 112px; font-size: 40px; margin: 0 auto; }
.nome-prestador { font-weight: 700; font-size: 16px; }
.metricas { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--texto2); margin-top: 3px; }
.selos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.selo { font-size: 12px; padding: 3px 8px; border-radius: 10px; background: var(--fundo2); white-space: nowrap; }
.selo.ok { background: rgba(31, 168, 85, .12); color: var(--verde); }
.selo.novo { background: var(--marca-clara); color: var(--marca); }
.perfil-topo { text-align: center; padding: 18px 14px; }
.perfil-topo .selos { justify-content: center; }
.numeros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.numeros .n { font-size: 20px; font-weight: 800; }
.numeros .r { font-size: 12px; color: var(--texto2); }
.fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fotos img, .fotos .add { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: pointer; }
.fotos .add { display: flex; align-items: center; justify-content: center; background: var(--fundo2);
  border: 2px dashed var(--borda); font-size: 28px; color: var(--texto2); }
.foto-wrap { position: relative; }
.foto-wrap .x { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: 0;
  border-radius: 50%; width: 26px; height: 26px; font-size: 14px; cursor: pointer; }

/* ---------- chips de seleção */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 13px; border-radius: 20px; background: var(--fundo); border: 1.5px solid var(--borda);
  cursor: pointer; font-size: 14px; user-select: none; }
.chip.on { background: var(--marca); color: #fff; border-color: var(--marca); }
.grupo-titulo { font-weight: 700; margin: 16px 0 8px; font-size: 15px; }

/* ---------- formulário */
.campo { width: 100%; padding: 14px; font-size: 17px; border-radius: 12px; border: 1.5px solid var(--borda);
  background: var(--fundo); color: var(--texto); outline: none; font-family: inherit; }
.campo:focus { border-color: var(--marca); }
textarea.campo { min-height: 120px; resize: vertical; }
.erro-campo { color: var(--erro); font-size: 14px; margin-top: 6px; min-height: 18px; }
.contador { text-align: right; font-size: 12px; color: var(--texto2); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--marca); flex-shrink: 0; margin-top: 2px; }
.switch { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.switch input { width: 48px; height: 28px; accent-color: var(--marca); }

/* ---------- cadastro */
.progresso { height: 6px; background: var(--fundo); border-radius: 3px; overflow: hidden; margin: 2px 0 14px; }
.progresso div { height: 100%; background: var(--marca); transition: width .3s; }
.passo-topo { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--texto2); }
.ajuda { color: var(--link); cursor: pointer; font-size: 14px; }
.dicas { list-style: none; padding: 0; margin: 8px 0; }
.dicas li { padding: 4px 0; font-size: 15px; }
.foto-preview { width: 100%; max-height: 300px; object-fit: contain; border-radius: 12px; background: var(--fundo2); display: block; }
.foto-preview.redonda { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; margin: 0 auto; }
.botoes-foto { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.botao { display: block; width: 100%; padding: 13px; border-radius: 12px; border: 0; font-size: 15px; font-weight: 600;
  cursor: pointer; text-align: center; background: var(--fundo2); color: var(--texto); font-family: inherit; }
.botao.cheio { background: var(--marca); color: #fff; }
.botao.zap { background: var(--zap); color: #fff; }
.botao.linkado { background: transparent; color: var(--link); padding: 10px; }
.botao:disabled { opacity: .5; }
.aviso { padding: 12px 14px; border-radius: 12px; background: rgba(201, 138, 0, .12); margin: 10px 0; font-size: 15px; }
.aviso.ruim { background: rgba(217, 48, 37, .1); }
.aviso.bom { background: rgba(31, 168, 85, .12); }
.revisao .item { cursor: pointer; }
.status-ok { color: var(--verde); font-weight: 700; }
.status-falta { color: var(--alerta); font-weight: 700; }
.grande-icone { font-size: 56px; text-align: center; margin: 20px 0 6px; }
.centro { text-align: center; }
.link-box { display: flex; gap: 8px; margin-top: 8px; }
.link-box input { flex: 1; min-width: 0; font-size: 13px; padding: 10px; }
.link-box .botao { width: auto; padding: 10px 14px; }

/* ---------- botão principal fora do Telegram */
.botao-principal { position: fixed; left: 12px; right: 12px; bottom: 12px; max-width: 536px; margin: 0 auto;
  padding: 16px; border: 0; border-radius: 14px; background: var(--marca); color: #fff; font-size: 17px; font-weight: 700;
  z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.botao-principal:disabled { opacity: .5; }

/* ---------- toast, visor, carregando */
.toast { position: fixed; left: 16px; right: 16px; bottom: 90px; max-width: 520px; margin: 0 auto; background: #2b2724;
  color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 15px; z-index: 20; text-align: center; }
.visor { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 30; display: flex; align-items: center; justify-content: center; }
.visor img { max-width: 100%; max-height: 100%; }
.carregando { display: flex; justify-content: center; padding: 60px 0; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--borda); border-top-color: var(--marca); border-radius: 50%;
  animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.vazio { text-align: center; padding: 30px 16px; color: var(--texto2); }
.vazio .grande-icone { margin-top: 0; }
.item .cresce { flex: 1; min-width: 0; }
.marca .ponto { color: var(--marca); }
