:root {
  color-scheme: light;
  --fundo: #F4EEE6;
  --cartao: #FFFFFF;
  --tinta: #23302B;
  --mudo: #5F5C53;
  --linha: #E6DED2;
  --linha-2: #F1ECE4;
  --trilho: #EFE8DD;
  --verde: #1C3B32;
  --verde-2: #2F6B55;
  --verde-claro: #E3EDE8;
  --areia: #D9A879;
  --terracota: #A0623A;
  --terracota-escuro: #8A4A26;
  --claro: #CFE0D8;
  --serifa: 'Fraunces', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--tinta); font-family: var(--sans); font-size: 15px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
body.travado { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }
h1 { font-family: var(--serifa); font-size: 26px; font-weight: 600; color: var(--verde); margin: 0; line-height: 1.15; }
h2 { font-family: var(--serifa); font-size: 21px; font-weight: 600; color: var(--verde); margin: 0; }
h3 { font-size: 15px; font-weight: 700; margin: 0; }
p { margin: 0; }
small { font-size: 12px; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ---------- estrutura ---------- */
.cabecalho { position: sticky; top: 0; z-index: 5; height: 64px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; background: var(--fundo); border-bottom: 1px solid var(--linha); }
.marca { display: flex; align-items: center; gap: 10px; }
.marca b { display: block; font-family: var(--serifa); font-size: 16px; font-weight: 600; color: var(--verde); line-height: 1.1; }
.marca small { color: var(--mudo); }
.selo-marca { width: 38px; height: 38px; border-radius: 10px; background: var(--verde); color: var(--fundo); display: grid; place-items: center; font-family: var(--serifa); font-weight: 600; font-size: 16px; flex-shrink: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #E9D6CC; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.avatar.grande { width: 44px; height: 44px; font-size: 17px; }
.faixa-mentora { position: sticky; top: 64px; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 16px; background: var(--verde); color: #fff; font-size: 13px; }
.conteudo { max-width: 560px; margin: 0 auto; padding: 20px 16px 120px; }
.conteudo.estreito { max-width: 440px; padding-top: 32px; }
.pilha { display: flex; flex-direction: column; gap: 14px; }
.duas, .tres { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.em-linha { display: flex; align-items: center; gap: 8px; }
.entre { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.entre.topo { align-items: flex-start; }
.cresce { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.min0 { min-width: 0; }
.corta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.direita { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; white-space: nowrap; }
.mudo { color: var(--mudo); }
.pequeno { font-size: 13px; }
.pos { color: var(--verde-2); }
.verde { color: var(--verde); }
.carregando { color: var(--mudo); text-align: center; padding: 40px 0; }
.sem-marcador { list-style: none; }

/* ---------- cartões ---------- */
.cartao { background: var(--cartao); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.cartao.escuro { background: var(--verde); color: #fff; border-radius: 22px; padding: 20px; }
.cartao.escuro .mini { background: rgba(255, 255, 255, .08); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 3px; }
.cartao.escuro .mini small { color: var(--claro); }
.cartao.escuro .mini b { font-size: 17px; }
.claro { color: var(--claro); }
.numero-grande { font-family: var(--serifa); font-size: 32px; font-weight: 600; line-height: 1.1; }
.numero { font-family: var(--serifa); font-size: 28px; font-weight: 600; }
.linha-clara { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 8px; font-size: 13px; }
.sobre { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--mudo); margin-top: 6px; }
.sobre.terracota { color: var(--terracota-escuro); margin: 0; }
.barra { background: var(--trilho); border-radius: 7px; overflow: hidden; }
.barra > div { height: 100%; border-radius: inherit; }
.cartao.escuro .barra { background: rgba(255, 255, 255, .15); }
.item-barra { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.legenda { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.legenda li, .leg { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legenda i, .leg i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.leg { align-items: flex-start; } .leg i { margin-top: 4px; }
.legenda i.vazio { background: var(--trilho); border: 1px solid #DCD3C6; }
.linha-fina { font-size: 13px; padding: 3px 0; border-bottom: 1px solid var(--linha-2); }
.porque { background: var(--fundo); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.selo { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px; background: var(--verde-claro); color: #24543F; white-space: nowrap; }
.selo.pendente { background: #F6E7D8; color: var(--terracota-escuro); }
.selo.st-aberta { background: #F6E7D8; color: var(--terracota-escuro); }
.selo.st-repactuada { background: #EFE3C8; color: #6B5320; }
.selo.st-quitada { background: var(--verde-claro); color: #24543F; }
.alerta { color: var(--terracota-escuro); font-weight: 600; }
.cab-mes { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ---------- listas ---------- */
.lista-lanc, .lista-div { padding: 4px 14px; gap: 0; }
.lista-lanc li, .lista-div li { border-bottom: 1px solid var(--linha-2); }
.lista-lanc li:last-child, .lista-div li:last-child { border-bottom: none; }
.lanc, .div { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 0; background: none; border: none; text-align: left; }
.div { align-items: flex-start; }
.div .cresce small { line-height: 1.35; }
li.lanc { display: flex; }
.ini { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.lista { border: 1px solid var(--trilho); border-radius: 16px; padding: 2px 12px; }
.linha { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--linha-2); }
.linha:last-child { border-bottom: none; }
.tempo { padding: 18px 16px; gap: 0; }
.tempo li { position: relative; padding: 0 0 16px 26px; display: flex; flex-direction: column; gap: 2px; }
.tempo li::before { content: ''; position: absolute; left: 3px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--verde-2); border: 2px solid var(--verde-2); }
.tempo li.futuro::before { background: #fff; border-color: var(--areia); }
.tempo li::after { content: ''; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: var(--trilho); }
.tempo li:last-child::after { display: none; }
.cliente { gap: 8px; }
.cliente .abrir { display: flex; align-items: center; gap: 12px; background: none; border: none; text-align: left; padding: 0; width: 100%; }
.cliente select { padding: 6px 8px; min-height: 36px; width: auto; }

/* ---------- botões ---------- */
.botao { min-height: 50px; border-radius: 16px; border: none; background: var(--verde); color: #fff; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; }
.botao.contorno { background: #fff; color: var(--verde); border: 1.5px solid var(--verde); }
.botao.pequeno { min-height: 40px; border-radius: 12px; font-size: 13px; padding: 0 12px; }
.botao.perigo.contorno { color: var(--terracota-escuro); border-color: #D9B49C; }
.link { background: none; border: none; color: var(--verde); font-weight: 700; font-size: 13px; padding: 6px 4px; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.link.claro { color: #fff; min-height: 32px; }
.redondo { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #DCD3C6; background: #fff; display: grid; place-items: center; flex-shrink: 0; }
.redondo.leve { border: none; background: transparent; width: 40px; height: 40px; }
.fab { position: fixed; right: max(20px, calc(50vw - 260px)); bottom: 92px; width: 60px; height: 60px; border-radius: 50%; border: none; background: var(--terracota); box-shadow: 0 8px 20px rgba(35, 48, 43, .28); display: grid; place-items: center; z-index: 6; }
.abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; height: calc(72px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--linha); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.abas button { border: none; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--mudo); font-size: 10.5px; font-weight: 700; }
.abas .pilula { width: 48px; height: 28px; border-radius: 14px; display: grid; place-items: center; }
.abas .ativo { color: var(--verde); }
.abas .ativo .pilula { background: var(--verde-claro); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.grade { display: grid; gap: 6px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid #DCD3C6; background: #fff; font-weight: 600; font-size: 13px; line-height: 1.15; }
.chips.grade .chip { border-radius: 12px; padding: 4px 6px; }
.chip.ativo { background: var(--verde); border-color: var(--verde); color: #fff; }
.segmentos { display: grid; gap: 4px; background: #E9E1D5; border-radius: 14px; padding: 4px; }
.segmentos button { min-height: 42px; border-radius: 11px; border: none; background: transparent; font-weight: 700; font-size: 13px; color: var(--tinta); padding: 0 4px; }
.segmentos button.ativo { background: #fff; color: var(--verde); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.ens { min-height: 34px; padding: 0 12px; border-radius: 17px; border: none; font-weight: 700; font-size: 12px; }
.ens-E { background: var(--verde); color: #fff; }
.ens-N { background: #EFE3C8; color: #6B5320; }
.ens-S { background: #F0DCD5; color: var(--terracota-escuro); }

/* ---------- formulários ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label, .rotulo { font-size: 12px; font-weight: 700; color: var(--mudo); }
.rotulo small { font-weight: 500; }
.dica { font-size: 12px; color: var(--mudo); }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 46px; border: 1px solid var(--linha); border-radius: 12px; padding: 10px 12px; background: #fff; font-size: 15px; }
textarea { resize: vertical; }
input.valor-grande { font-family: var(--serifa); font-size: 30px; font-weight: 600; border: none; border-bottom: 2px solid var(--linha); border-radius: 0; padding: 4px 0; background: transparent; }
.marcar { display: flex; align-items: center; gap: 10px; font-size: 13px; min-height: 46px; }
.marcar input { width: 20px; height: 20px; accent-color: var(--verde); flex-shrink: 0; }
.duas > .marcar { align-self: end; }
.caixa { background: var(--fundo); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.caixa.verde-claro { background: var(--verde-claro); }
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: none; background: none; padding: 0; min-height: 44px; text-align: left; }
.interruptor .txt { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.interruptor small { color: var(--mudo); }
.trilho { width: 46px; height: 28px; border-radius: 14px; background: #CFC6B8; position: relative; flex-shrink: 0; transition: background .15s; }
.trilho span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; }
.trilho.on { background: var(--verde); }
.trilho.on span { left: 21px; }
.linha-teto { display: grid; grid-template-columns: 1fr 130px; align-items: center; gap: 8px; font-size: 13px; }
.linha-teto input { min-height: 38px; padding: 6px 10px; font-size: 14px; }
.smart { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--mudo); }
.smart .ok { color: var(--verde-2); font-weight: 700; }
.erro { color: var(--terracota-escuro); font-weight: 600; font-size: 13px; }
.nota { font-size: 12.5px; color: var(--mudo); }
.nota.ok { color: #24543F; background: var(--verde-claro); padding: 10px 12px; border-radius: 12px; font-weight: 600; }
.em-linha input { flex: 1; min-width: 0; }
.termo .texto-termo { max-height: 50vh; overflow-y: auto; border: 1px solid var(--trilho); border-radius: 14px; padding: 4px 14px 14px; font-size: 13.5px; }
.texto-termo h3 { margin: 12px 0 4px; font-size: 14px; }
.texto-termo p { margin: 0 0 6px; }

/* ---------- folha (modal) ---------- */
.veu { position: fixed; inset: 0; z-index: 20; background: rgba(20, 30, 25, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 26px 26px 0 0; padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; position: sticky; top: -18px; background: #fff; padding: 4px 0; z-index: 1; }
.sheet-topo .redondo { border: none; background: var(--fundo); }
@media (min-width: 640px) {
  .veu { align-items: center; }
  .sheet { border-radius: 26px; max-height: 88vh; }
}
.aviso { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 30; background: var(--tinta); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); }
@media (max-width: 380px) {
  .tres { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .numero-grande { font-size: 28px; }
}
