:root {
  --azul: #1d5bd8;
  --azul-escuro: #123c94;
  --azul-claro: #e8f0ff;
  --azul-medio: #a9c3f7;
  --texto: #0f1b33;
  --suave: #5b6b86;
  --linha: #e3e9f3;
  --fundo: #ffffff;
  --fundo-2: #f6f8fc;
  --ok: #138a52;
  --alerta: #c2410c;
  --alerta-claro: #fff4ec;
  --raio: 16px;
  --sombra: 0 1px 2px rgba(15, 27, 51, .06), 0 4px 16px rgba(15, 27, 51, .06);
  --nav-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--azul); }
.tela { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 16px) 16px 16px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; letter-spacing: -.02em; }
h2 { font-size: 18px; }
.sub { color: var(--suave); font-size: 14px; }
.topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* cartões */
.cartao { background: var(--fundo); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; box-shadow: var(--sombra); margin-bottom: 14px; }
.cartao.azul { background: var(--azul); color: #fff; border-color: var(--azul); }
.cartao.azul .sub { color: rgba(255,255,255,.8); }
.cartao.aviso-atraso { background: var(--alerta-claro); border-color: #ffd9bf; box-shadow: none; }
.titulo-cartao { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }

/* chips de situação */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--azul-claro); color: var(--azul-escuro); }
.chip.ok { background: #e6f6ee; color: var(--ok); }
.chip.alerta { background: var(--alerta-claro); color: var(--alerta); }
.chip.branco { background: rgba(255,255,255,.18); color: #fff; }

/* resumo do topo */
.resumo { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.anel { width: 84px; height: 84px; position: relative; }
.anel svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anel .valor { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 700; font-size: 18px; line-height: 1.05; }
.anel .valor small { display: block; font-size: 11px; font-weight: 500; opacity: .8; }
.numeros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.numero b { display: block; font-size: 20px; line-height: 1.1; }
.numero span { font-size: 12px; opacity: .85; }

/* checklist */
.item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--linha); }
.item:first-of-type { border-top: 0; padding-top: 2px; }
.caixa { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--azul-medio); background: #fff; display: grid; place-items: center; transition: background .15s, border-color .15s, transform .1s; }
.caixa:active { transform: scale(.92); }
.caixa svg { width: 20px; height: 20px; opacity: 0; transition: opacity .15s; }
.caixa.marcada { background: var(--azul); border-color: var(--azul); }
.caixa.marcada svg { opacity: 1; }
.item .rotulo { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); font-weight: 600; }
.item .ref { font-size: 19px; font-weight: 650; margin: 2px 0 8px; }
.item.feito .ref { color: var(--suave); text-decoration: line-through; text-decoration-color: var(--azul-medio); }
.caps { display: flex; flex-wrap: wrap; gap: 6px; }
.cap { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--linha); text-decoration: none; color: var(--azul-escuro); background: var(--fundo-2); min-height: 32px; }
.cap svg { width: 13px; height: 13px; }

textarea { width: 100%; min-height: 88px; resize: vertical; border: 1px solid var(--linha); border-radius: 12px; padding: 12px; background: var(--fundo-2); font-size: 16px; }
textarea:focus, input:focus { outline: 2px solid var(--azul); outline-offset: 0; border-color: transparent; background: #fff; }
.dica { font-size: 12px; color: var(--suave); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--linha); background: #fff; font-weight: 600; color: var(--azul-escuro); text-decoration: none; }
.btn.primario { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn.bloco { width: 100%; }
.btn.pequeno { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .55; }
.btn svg { width: 18px; height: 18px; }
.linha-btns { display: flex; gap: 8px; margin-top: 12px; }
.linha-btns .btn { flex: 1; }

/* concluído */
.concluido { text-align: center; padding: 8px 0 4px; }
.concluido .selo { width: 56px; height: 56px; border-radius: 50%; background: var(--azul); display: grid; place-items: center; margin: 0 auto 10px; animation: pulo .5s ease; }
.concluido .selo svg { width: 30px; height: 30px; }
@keyframes pulo { 0% { transform: scale(.4); opacity: 0 } 70% { transform: scale(1.1) } 100% { transform: scale(1); opacity: 1 } }

/* listas */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { border-top: 1px solid var(--linha); }
.lista li:first-child { border-top: 0; }
.linha-dia { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 12px 2px; background: none; border: 0; text-align: left; }
.linha-dia .n { font-weight: 700; color: var(--azul); font-size: 15px; text-align: center; }
.linha-dia .t { font-size: 15px; font-weight: 600; }
.linha-dia .t small { display: block; font-weight: 400; color: var(--suave); font-size: 13px; }
.bolinha { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--linha); display: grid; place-items: center; }
.bolinha.feito { background: var(--azul); border-color: var(--azul); }
.bolinha.meio { border-color: var(--azul); background: linear-gradient(90deg, var(--azul) 50%, #fff 50%); }
.bolinha.atrasado { border-color: #f3b38c; }
.bolinha svg { width: 14px; height: 14px; }
.linha-dia.hoje { background: var(--azul-claro); border-radius: 12px; }
.mes { font-size: 13px; font-weight: 700; color: var(--suave); text-transform: uppercase; letter-spacing: .06em; padding: 18px 2px 6px; position: sticky; top: 0; background: var(--fundo); z-index: 1; }

/* abas */
.abas { display: flex; background: var(--fundo-2); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.abas button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: none; font-weight: 600; color: var(--suave); font-size: 14px; }
.abas button.ativa { background: #fff; color: var(--azul-escuro); box-shadow: var(--sombra); }

/* ranking */
.podio { display: grid; gap: 10px; }
.competidor { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--linha); border-radius: var(--raio); background: #fff; }
.competidor.eu { border-color: var(--azul); box-shadow: 0 0 0 1px var(--azul) inset; }
.competidor.primeiro { background: linear-gradient(180deg, #f2f6ff, #fff); }
.pos { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: var(--fundo-2); color: var(--suave); }
.primeiro .pos { background: var(--azul); color: #fff; }
.competidor .nome { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.competidor .meta { font-size: 13px; color: var(--suave); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.competidor .meta span { display: inline-flex; align-items: center; gap: 3px; }
.competidor .meta svg { width: 13px; height: 13px; }
.pts { text-align: right; }
.pts b { font-size: 22px; color: var(--azul-escuro); display: block; line-height: 1; }
.pts small { font-size: 11px; color: var(--suave); }
.barra { height: 6px; background: var(--fundo-2); border-radius: 99px; overflow: hidden; margin-top: 8px; grid-column: 2 / 4; }
.barra i { display: block; height: 100%; background: var(--azul); border-radius: 99px; }
.mini { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.mini.ok { background: #e6f6ee; color: var(--ok); }
.mini.pend { background: var(--fundo-2); color: var(--suave); }
.mini.fim { background: var(--azul); color: #fff; }

.feed li { display: flex; gap: 10px; padding: 10px 0; font-size: 14px; align-items: flex-start; }
.feed .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--azul); margin-top: 7px; flex: none; }
.feed time { color: var(--suave); font-size: 12px; display: block; }

.regras { font-size: 14px; color: var(--suave); }
.regras li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px dashed var(--linha); }
.regras li:first-child { border-top: 0; }
.regras b { color: var(--azul-escuro); }

/* calendário de 365 */
.grade { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; }
.grade button { aspect-ratio: 1; border: 0; border-radius: 4px; background: var(--fundo-2); padding: 0; }
.grade .f { background: var(--azul); }
.grade .a { background: var(--azul-medio); }
.grade .p { background: #fde2d0; }
.grade .h { outline: 2px solid var(--azul-escuro); outline-offset: 1px; }
.legenda { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--suave); margin-top: 10px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* conquistas */
.conquistas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.conquista { text-align: center; padding: 12px 6px; border-radius: 14px; background: var(--fundo-2); font-size: 12px; color: var(--suave); }
.conquista .ic { width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; background: #fff; border: 1px solid var(--linha); }
.conquista .ic svg { width: 20px; height: 20px; }
.conquista b { display: block; color: var(--texto); font-size: 13px; }
.conquista.ganha { background: var(--azul-claro); color: var(--azul-escuro); }
.conquista.ganha .ic { background: var(--azul); border-color: var(--azul); }
.conquista:not(.ganha) { opacity: .7; }

.reflexao { padding: 12px 0; border-top: 1px solid var(--linha); }
.reflexao:first-child { border-top: 0; padding-top: 0; }
.reflexao p { margin: 4px 0 0; white-space: pre-wrap; font-size: 15px; }
.reflexao button { background: none; border: 0; padding: 0; color: var(--azul); font-weight: 600; font-size: 13px; }

/* navegação inferior */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--linha); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
.nav .dentro { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 560px; }
.nav button { height: var(--nav-h); border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--suave); position: relative; }
.nav button svg { width: 24px; height: 24px; }
.nav button.ativa { color: var(--azul); }
.nav button.ativa::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--azul); }
.nav .badge { position: absolute; top: 10px; right: calc(50% - 20px); width: 9px; height: 9px; border-radius: 50%; background: var(--alerta); border: 2px solid #fff; }

/* folha (bottom sheet) */
.folha { position: fixed; inset: 0; z-index: 40; background: rgba(15, 27, 51, .38); display: flex; align-items: flex-end; justify-content: center; }
.folha[hidden] { display: none; }
.folha .painel { background: #fff; width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); animation: sobe .22s ease; }
.folha .alca { width: 40px; height: 5px; border-radius: 9px; background: var(--linha); margin: 0 auto 12px; }
@keyframes sobe { from { transform: translateY(40px); opacity: .4 } to { transform: none; opacity: 1 } }
@media (min-width: 700px) { .folha { align-items: center; } .folha .painel { border-radius: 22px; } }

/* login */
.entrada { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px; max-width: 420px; margin: 0 auto; }
.marca { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.marca .logo { width: 52px; height: 52px; border-radius: 14px; background: var(--azul); display: grid; place-items: center; }
.marca .logo svg { width: 28px; height: 28px; }
.campo { display: block; margin-bottom: 12px; }
.campo span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--suave); }
.campo input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--linha); border-radius: 12px; background: var(--fundo-2); font-size: 16px; }
.erro { color: #b42318; font-size: 14px; min-height: 20px; margin: 4px 0 8px; }
.troca { text-align: center; margin-top: 16px; font-size: 15px; }
.troca button { background: none; border: 0; color: var(--azul); font-weight: 700; padding: 8px; }

.aviso { position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); transform: translate(-50%, 20px); background: var(--texto); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.aviso.on { opacity: 1; transform: translate(-50%, 0); }

.vazio { text-align: center; color: var(--suave); padding: 20px 8px; font-size: 14px; }
.carregando { display: grid; place-items: center; min-height: 60dvh; color: var(--suave); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mt { margin-top: 12px; }
.centro { text-align: center; }

/* escolha de rota */
.rotas { display: grid; gap: 10px; padding-bottom: 8px; }
.rota { display: block; position: relative; border: 1.5px solid var(--linha); border-radius: var(--raio); padding: 14px 14px 12px 46px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.rota input { position: absolute; left: 14px; top: 16px; width: 20px; height: 20px; accent-color: var(--azul); margin: 0; }
.rota.sel { border-color: var(--azul); background: #f5f8ff; box-shadow: 0 0 0 1px var(--azul) inset; }
.rota-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rota-topo b { font-size: 16px; }
.rota-resumo { font-size: 14px; margin-top: 4px; }
.rota-detalhe { font-size: 13px; color: var(--suave); margin-top: 4px; }
.rota-dia1 { font-size: 13px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--linha); color: var(--azul-escuro); }
.rota-dia1 span { color: var(--suave); }
.rodape-fixo { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); padding: 10px 0 4px; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%); }
#nav[hidden] ~ * .rodape-fixo, body:has(#nav[hidden]) .rodape-fixo { bottom: calc(env(safe-area-inset-bottom) + 8px); }

/* dia concluído */
.faixa-ok { display: flex; align-items: center; gap: 8px; background: var(--azul); color: #fff; font-weight: 600; font-size: 14px; margin: -16px -16px 14px; padding: 10px 16px; border-radius: var(--raio) var(--raio) 0 0; }
.faixa-ok svg { width: 18px; height: 18px; flex: none; }
.cartao-ok { border-color: var(--azul-medio); }
.btn.desfazer { color: var(--suave); background: var(--fundo-2); border-color: var(--linha); font-weight: 600; }

/* resumo do dia */
.diario-dia { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--linha); }
.diario-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.diario-topo h3 { font-size: 16px; color: var(--azul-escuro); }
.salvo { font-size: 12px; color: var(--suave); min-height: 16px; text-align: right; }
.salvo.erro-salvar { color: #b42318; }
.campo-d { display: block; margin-bottom: 12px; }
.campo-d > span { display: block; font-size: 13px; font-weight: 600; color: var(--texto); margin-bottom: 6px; }
.campo-d em { font-style: normal; font-weight: 400; color: var(--suave); }
.campo-d textarea { min-height: 0; }
.campo-d textarea[data-campo="ensinamento"] { font-weight: 600; color: var(--azul-escuro); }
.campo-d input { width: 100%; height: 46px; padding: 0 12px; border: 1px solid var(--linha); border-radius: 12px; background: var(--fundo-2); font-size: 16px; }

/* diário */
.busca { display: flex; align-items: center; gap: 8px; border: 1px solid var(--linha); background: var(--fundo-2); border-radius: 12px; padding: 0 12px; margin-bottom: 14px; }
.busca svg { width: 18px; height: 18px; color: var(--suave); flex: none; }
.busca input { flex: 1; border: 0; background: none; height: 46px; font-size: 16px; outline: none; min-width: 0; }
.busca:focus-within { border-color: var(--azul); background: #fff; }
.entrada-diario { border: 1px solid var(--linha); border-radius: var(--raio); padding: 14px 16px; margin-bottom: 12px; background: #fff; box-shadow: var(--sombra); }
.entrada-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.entrada-ref { font-size: 13px; color: var(--suave); margin: 2px 0 8px; }
.entrada-diario blockquote { margin: 8px 0; padding: 4px 0 4px 12px; border-left: 3px solid var(--azul); font-size: 17px; font-weight: 600; color: var(--azul-escuro); white-space: pre-wrap; }
.entrada-diario p { margin: 8px 0 0; white-space: pre-wrap; font-size: 15px; }
.chip.versiculo { margin-top: 4px; }
.link { background: none; border: 0; padding: 0; color: var(--azul); font-weight: 700; font-size: 14px; }
.icone-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--linha); background: #fff; display: grid; place-items: center; color: var(--azul-escuro); flex: none; }
.icone-btn svg { width: 18px; height: 18px; }
.linha-link { display: flex; width: 100%; justify-content: space-between; align-items: center; text-align: left; font: inherit; color: inherit; }
.linha-link > span { display: grid; gap: 2px; }
.linha-link svg { width: 20px; height: 20px; color: var(--azul); }

/* senha */
.senha-caixa { position: relative; }
.senha-caixa input { padding-right: 52px; }
.ver-senha { position: absolute; right: 4px; top: 4px; width: 44px; height: 42px; border: 0; background: none; color: var(--suave); display: grid; place-items: center; }
.ver-senha svg { width: 20px; height: 20px; }
.ver-senha.on { color: var(--azul); }
