/* Receita Previsível · visual de recorte: contorno de tinta, sombra sólida, colagem e rabisco. */
:root {
  --fundo: #f5efe7;
  --tinta: #2b2b2b;
  --acento: #b85c38;
  --laranja: #dc6b2f;
  --pessego: #f4cdb0;
  --areia: #e6dacb;
  --suave: #6b625b;
  --linha: #d4c8be;
  --linha-clara: #efe7dd;
  --cartao: #fffaf4;
  --escuro: #2b2b2b;
  --escuro-2: #4a4541;
  --ok: #2f6b45;
  --raio: 20px;
  --sombra: 3px 3px 0 var(--tinta);
  --sombra-g: 5px 5px 0 var(--tinta);
  --serif: "Boldonse", "DM Sans", system-ui, sans-serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--tinta); font-family: var(--sans); font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; font-variant-numeric: lining-nums; }
button, input, select, textarea { font-family: inherit; font-size: 16px; color: inherit; }
a { color: var(--acento); }
img { max-width: 100%; display: block; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.42; margin: 0; letter-spacing: 0; overflow-wrap: anywhere; }
h3 { font-family: var(--sans); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 27px; }
h2 { font-size: 19px; }
h3 { font-size: 19px; }
p { line-height: 1.5; margin: 0; }
.suave { color: var(--suave); }
.pequeno { font-size: 13px; }
.rotulo { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--suave); }
.rotulo.acento { color: var(--acento); }

/* Estrutura */
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.tela { flex: 1; display: flex; flex-direction: column; padding: 18px 20px 28px; gap: 16px; animation: entra .28s ease-out; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tela.com-nav { padding-bottom: 110px; }
.topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; }
.logo { font-weight: 700; font-size: 14px; line-height: 0.95; letter-spacing: -0.01em; color: var(--tinta); text-decoration: none; display: inline-block; }
.logo span { margin-left: 10px; }
.pilula { font-size: 13px; font-weight: 700; background: var(--cartao); border: 2px solid var(--tinta); border-radius: 999px; padding: 6px 12px; display: inline-flex; align-items: center; gap: 6px; }
.pilula.quente { background: var(--laranja); }
.espaco { flex: 1; }
.linha { display: flex; gap: 8px; align-items: center; }
.linha.entre { justify-content: space-between; }
.coluna { display: flex; flex-direction: column; gap: 10px; }
.grade3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* Título com rabisco */
.titulo-rabiscado { position: relative; display: inline-block; align-self: flex-start; }
.titulo-rabiscado > span:first-child { position: relative; z-index: 1; }
.titulo-rabiscado { line-height: 1; padding-bottom: 6px; }
.rabisco-sublinhado { position: absolute; left: -4px; right: -6px; bottom: 0; height: 14px; z-index: 0; line-height: 0; display: block; }
.rabisco-sublinhado svg { width: 100%; height: 14px; }

/* Navegação inferior */
nav.principal { position: fixed; bottom: 0; left: 0; right: 0; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); z-index: 10; pointer-events: none; }
nav.principal .itens { pointer-events: auto; max-width: 496px; margin: 0 auto; display: flex; background: var(--escuro); border-radius: 22px; padding: 6px; box-shadow: 0 8px 24px rgba(43,43,43,.18); }
nav.principal a { flex: 1; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: #cfc4b9; font-size: 10.5px; font-weight: 500; border-radius: 16px; }
nav.principal a[aria-current="page"] { background: var(--laranja); color: var(--tinta); font-weight: 700; }
nav.principal svg { width: 22px; height: 22px; }

/* Cartões de recorte */
.cartao { background: var(--cartao); border: 2px solid var(--tinta); border-radius: var(--raio); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--sombra); }
.cartao.destaque { box-shadow: var(--sombra-g); }
.cartao.escuro { background: var(--escuro); color: var(--fundo); }
.cartao.escuro .suave { color: #cfc4b9; }
.cartao.tracejado { background: transparent; border-style: dashed; box-shadow: none; }
.cartao.contorno { background: transparent; box-shadow: none; }
.cartao.sem-borda { border: 0; box-shadow: none; }
.cartao.feita { opacity: 0.72; box-shadow: none; }
.cor-clarear, .cor-aparecer { background: var(--pessego); }
.cor-conversar { background: var(--laranja); }
.cor-medir { background: var(--areia); }
.cor-anunciar { background: var(--escuro); color: var(--fundo); }
.cor-anunciar .suave, .cor-anunciar .rotulo { color: #cfc4b9; }
.numero-grande { font-family: var(--serif); font-size: 28px; line-height: 1.2; color: var(--laranja); font-weight: 400; }
.numero { font-family: var(--sans); font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.barra { height: 8px; background: var(--escuro-2); border-radius: 99px; overflow: hidden; }
.barra > div { height: 8px; background: var(--laranja); border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.barra.clara { background: var(--linha); border: 1.5px solid var(--tinta); height: 12px; }
.barra.clara > div { height: 9px; }
.etapas { display: flex; gap: 6px; }
.etapas > div { flex: 1; height: 8px; border-radius: 99px; background: var(--linha); }
.etapas > div.feita { background: var(--acento); }
.mensagem { background: var(--fundo); border: 1.5px dashed var(--tinta); border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.passos { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.45; }
.aviso { background: #fbe1cd; border: 2px solid var(--tinta); border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.4; }
.selo { font-size: 12px; font-weight: 700; color: var(--tinta); background: var(--fundo); border: 1.5px solid var(--tinta); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.selo.ok { background: #d6ead9; }
.etiqueta { display: inline-flex; align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--cartao); border: 1.5px solid var(--tinta); border-radius: 999px; padding: 4px 10px; }

/* Botões */
.botao { min-height: 54px; border: 2px solid var(--tinta); border-radius: 16px; background: var(--acento); color: #fff; font-size: 17px; font-weight: 700; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; cursor: pointer; width: 100%; box-shadow: var(--sombra); transition: transform .08s, box-shadow .08s; }
.botao:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tinta); }
.botao:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.botao.secundario { background: var(--cartao); color: var(--tinta); }
.botao.terciario { background: transparent; color: var(--tinta); font-weight: 500; box-shadow: none; }
.botao.claro { background: var(--fundo); color: var(--tinta); }
.botao.pequeno { min-height: 46px; font-size: 15px; border-radius: 14px; width: auto; }
.botoes { display: flex; gap: 8px; }
.botoes > * { flex: 1; }
.link { background: none; border: 0; padding: 0; min-height: 44px; color: var(--tinta); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; }
.link.acento { color: var(--acento); font-weight: 700; }
.icone-botao { width: 44px; height: 44px; border-radius: 14px; border: 2px solid var(--tinta); background: var(--cartao); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; color: var(--tinta); }
.icone-botao:disabled { opacity: .35; }

/* Opções do questionário */
.opcoes { display: flex; flex-direction: column; gap: 10px; }
.opcao { min-height: 56px; text-align: left; padding: 12px 16px; border-radius: 16px; border: 2px solid var(--tinta); background: var(--cartao); font-size: 16px; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: transform .12s, box-shadow .12s, background .12s; box-shadow: 2px 2px 0 var(--tinta); }
.opcao:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--tinta); }
.opcao[aria-pressed="true"], .opcao[aria-checked="true"] { background: var(--laranja); font-weight: 700; box-shadow: var(--sombra); }
.opcao .marca { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--tinta); flex: none; display: flex; align-items: center; justify-content: center; background: var(--cartao); }
.opcao .marca span { opacity: 0; }
.opcao[aria-checked="true"] .marca { background: var(--tinta); }
.opcao[aria-checked="true"] .marca span { opacity: 1; }
.dias { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.dias .opcao { justify-content: center; padding: 0; font-size: 14px; min-height: 52px; box-shadow: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 20px 6px; margin: 0 -20px; scrollbar-width: none; }
.chip { flex: none; background: var(--cartao); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 500; border: 2px solid var(--tinta); min-height: 38px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--tinta); color: var(--fundo); font-weight: 700; }

/* Formulários */
label.campo { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; flex: 1; min-width: 0; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  min-height: 50px; border-radius: 14px; border: 2px solid var(--tinta); background: var(--cartao); padding: 10px 12px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.4; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--laranja); outline-offset: 2px; }
label.marcar { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; font-size: 15px; line-height: 1.4; cursor: pointer; }
label.marcar input { width: 24px; height: 24px; margin: 0; accent-color: var(--acento); flex: none; }
.passo-num { display: flex; align-items: center; gap: 12px; }
.passo-num button { width: 52px; height: 52px; border-radius: 16px; border: 2px solid var(--tinta); background: var(--cartao); font-size: 24px; cursor: pointer; box-shadow: 2px 2px 0 var(--tinta); }
.passo-num output { font-size: 34px; font-weight: 700; min-width: 48px; text-align: center; }
.erro { color: #a3361a; font-size: 14px; }

/* Folha de baixo */
.fundo-folha { position: fixed; inset: 0; background: rgba(43, 43, 43, 0.5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: aparece .18s; }
.folha { background: var(--fundo); width: 100%; max-width: 520px; border: 2px solid var(--tinta); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 14px 20px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; max-height: 92dvh; overflow-y: auto; animation: sobe .25s cubic-bezier(.2,.8,.2,1); }
.folha .alca { width: 48px; height: 5px; background: var(--tinta); border-radius: 99px; margin: 0 auto; opacity: .3; }
@keyframes sobe { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes aparece { from { opacity: 0; } }

/* Aviso flutuante */
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top)); background: var(--escuro); color: var(--fundo); padding: 12px 16px; border-radius: 16px; font-size: 14px; z-index: 40; max-width: calc(100% - 32px); border: 2px solid var(--tinta); box-shadow: 3px 3px 0 var(--laranja); animation: desce .25s; }
@keyframes desce { from { transform: translate(-50%, -12px); opacity: 0; } }

/* Colagem: foto com fita e estrela */
.colagem { position: relative; margin: 8px 6px 4px; transform: rotate(var(--inclina, -2deg)); }
.colagem img { width: 100%; aspect-ratio: 780 / 520; object-fit: cover; border: 2px solid var(--tinta); border-radius: 6px;
  clip-path: polygon(0 2%, 6% 0, 14% 1.5%, 23% 0, 34% 1%, 46% 0, 58% 1.5%, 70% 0, 82% 1%, 92% 0, 100% 1.5%, 99% 30%, 100% 62%, 99% 100%, 88% 98.5%, 75% 100%, 61% 98.5%, 48% 100%, 34% 98.5%, 20% 100%, 8% 98.5%, 0 100%, 1% 66%, 0 33%); }
.fita { position: absolute; width: 84px; height: 24px; background: rgba(244, 205, 176, .88); border: 1px solid rgba(43,43,43,.25); z-index: 2; }
.fita-1 { top: -10px; left: 14px; transform: rotate(-8deg); }
.fita-2 { bottom: -8px; right: 18px; transform: rotate(6deg); }
.colagem .rabisco-estrela { position: absolute; top: -16px; right: -6px; z-index: 3; transform: rotate(12deg); }

/* Ilustração de colagem pronta */
.ilustracao { margin: 0; display: flex; justify-content: center; }
.ilustracao img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; mix-blend-mode: multiply; }

/* Personagem: piscar, andar, guia com balão */
.boneco .b-olhos { transform-box: fill-box; transform-origin: 50% 50%; animation: pisca 5s infinite; }
@keyframes pisca { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.12); } }
.boneco-calma .b-olhos { animation: none; }
.boneco-anda .b-perna-e, .boneco-anda .b-perna-d { transform-box: fill-box; transform-origin: 50% 0; animation: passo .38s ease-in-out infinite alternate; }
.boneco-anda .b-perna-d { animation-direction: alternate-reverse; }
.boneco-anda .b-corpo { animation: bamboleia .38s ease-in-out infinite alternate; }
@keyframes passo { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes bamboleia { from { transform: translateY(0); } to { transform: translateY(-1.5px); } }
.guia { display: flex; align-items: flex-end; gap: 6px; }
.guia .boneco { flex: none; }
.balao { position: relative; background: var(--cartao); border: 2px solid var(--tinta); border-radius: 18px; padding: 10px 14px; font-size: 15px; line-height: 1.4; box-shadow: 2px 2px 0 var(--tinta); margin-bottom: 30px; animation: balao .35s cubic-bezier(.3,1.5,.5,1) both; }
.balao::before { content: ""; position: absolute; left: -9px; bottom: 12px; width: 14px; height: 14px; background: var(--cartao); border-left: 2px solid var(--tinta); border-bottom: 2px solid var(--tinta); transform: rotate(45deg); }
@keyframes balao { from { transform: scale(.7); opacity: 0; } }
.trilha { position: relative; height: 66px; display: flex; align-items: flex-end; }
.trilha .barra { flex: 1; margin-bottom: 4px; }
.trilha .boneco { position: absolute; bottom: 8px; transform: translateX(-50%); transition: left .5s cubic-bezier(.2,.8,.2,1); }
.celebracao-palco.imagem { width: 260px; height: 260px; }
.celebracao-palco.imagem img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.boneco-canto { position: absolute; left: -26px; bottom: -6px; }

/* Boneco */
.boneco { display: inline-block; line-height: 0; }
.boneco-oi svg { animation: balanca 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.boneco-festa svg { animation: pula .7s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.boneco-calma svg { animation: respira 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes balanca { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes pula { from { transform: translateY(0) scale(1, 1); } to { transform: translateY(-10px) scale(.98, 1.03); } }
@keyframes respira { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03, .98); } }
.palco { position: relative; display: flex; justify-content: center; align-items: flex-end; padding-top: 8px; }
.palco .rabisco-estrela { position: absolute; }
.palco .e1 { top: 6px; left: 22%; }
.palco .e2 { top: 40px; right: 20%; transform: scale(.7) rotate(18deg); }

/* Celebração */
.celebracao { position: fixed; inset: 0; z-index: 50; background: var(--fundo); display: flex; align-items: safe center; justify-content: center; padding: 28px 20px; overflow-y: auto; animation: aparece .2s; }
.celebracao.saindo { animation: some .22s forwards; }
@keyframes some { to { opacity: 0; } }
.celebracao-caixa { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; position: relative; z-index: 2; }
.celebracao-palco { position: relative; width: 180px; height: 180px; display: flex; align-items: center; justify-content: center; }
.celebracao-palco .rabisco-raios { position: absolute; inset: 0; animation: gira 6s linear infinite; }
.celebracao-palco .rabisco-raios svg { width: 180px; height: 180px; }
@keyframes gira { to { transform: rotate(360deg); } }
.selo-carimbo { position: absolute; right: -36px; top: 8px; background: var(--laranja); color: var(--tinta); border: 2.5px solid var(--tinta); border-radius: 12px; padding: 6px 12px; font-weight: 700; font-size: 18px; transform: rotate(12deg); box-shadow: var(--sombra); animation: carimba .45s cubic-bezier(.3,1.6,.5,1) .15s both; }
@keyframes carimba { from { transform: rotate(30deg) scale(2.2); opacity: 0; } to { transform: rotate(12deg) scale(1); opacity: 1; } }
.celebracao-titulo { font-size: 28px; }
.celebracao-frase { font-size: 18px; line-height: 1.45; max-width: 340px; }
.celebracao-chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chip-numero { display: flex; flex-direction: column; align-items: center; background: var(--cartao); border: 2px solid var(--tinta); border-radius: 16px; padding: 8px 14px; min-width: 92px; box-shadow: 2px 2px 0 var(--tinta); }
.chip-numero strong { font-size: 26px; line-height: 1.1; }
.chip-numero span { font-size: 12px; color: var(--suave); }
.papeis { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.papel { position: absolute; top: -20px; border: 1px solid var(--tinta); border-radius: 2px; animation: cai var(--dur) cubic-bezier(.3,.6,.5,1) var(--atraso) forwards; }
@keyframes cai { to { transform: translate(var(--desvio), 105vh) rotate(var(--gira)); } }
.conquista { display: flex; gap: 12px; align-items: center; text-align: left; background: var(--cartao); border: 2px solid var(--tinta); border-radius: 16px; padding: 10px 14px; }
.conquista.nova { background: var(--pessego); box-shadow: var(--sombra); animation: surge .5s cubic-bezier(.3,1.6,.5,1) .4s both; }
@keyframes surge { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.conquista.bloqueada { opacity: .45; border-style: dashed; }

/* Anel */
.anel { line-height: 0; }
.anel-progresso { transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }

/* Tarefa (Hoje) */
.tarefa { position: relative; }
.tarefa .cabeca { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tarefa .tempo { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; }
.tarefa.compacta { flex-direction: row; align-items: center; gap: 12px; cursor: pointer; }
.tarefa .conferido { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--tinta); display: flex; align-items: center; justify-content: center; background: var(--cartao); flex: none; }
.tarefa.feita .conferido { background: var(--tinta); color: var(--fundo); }
.bloco-hoje { flex-direction: row; align-items: center; gap: 16px; }

/* Tabelas */
.tabela-rolagem { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1.5px solid var(--linha-clara); vertical-align: top; }
th { font-size: 12px; color: var(--suave); font-weight: 700; }
td.num, th.num { text-align: center; width: 46px; }

/* Texto longo (política) */
.texto-longo { max-width: 680px; margin: 0 auto; padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 14px; }
.texto-longo h2 { margin-top: 14px; }
.texto-longo ul { margin: 0; padding-left: 20px; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Impressão (PDF da rotina) */
@media print {
  nav.principal, .nao-imprimir { display: none !important; }
  body, html { background: #fff; }
  .tela { padding: 0; animation: none; }
  .cartao { break-inside: avoid; box-shadow: none; }
  #app { max-width: none; }
}
