:root {
  --bg: #faf7f2; --card: #ffffff; --txt: #1f2937; --mute: #6b7280; --linha: #e7e2d9;
  --pri: #0f766e; --pri-esc: #115e59; --pri-claro: #ccfbf1; --acento: #f59e0b;
  --alerta: #b91c1c; --alerta-bg: #fef2f2; --ok: #15803d;
  --raio: 14px; --sombra: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--txt); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--pri); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.oculto { display: none; }

.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--linha); }
.topo h1 { font-size: 1.05rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-voltar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--txt); }
.marca { font-weight: 800; color: var(--pri); font-size: .85rem; letter-spacing: .02em; }
.conteudo { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.abas { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: var(--card); border-top: 1px solid var(--linha); padding-bottom: env(safe-area-inset-bottom); }
.abas a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: .72rem; color: var(--mute); text-decoration: none; min-height: 56px; }
.abas a.ativa { color: var(--pri); font-weight: 700; }

.card { background: var(--card); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; margin: 0 0 12px; box-shadow: var(--sombra); }
.link-card { display: block; text-decoration: none; color: inherit; position: relative; }
.link-card small, .card > small { display: block; color: var(--pri); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.link-card p { color: var(--mute); margin: 0; font-size: .92rem; }
.link-card h3 { margin-bottom: 4px; }
.card.feito { border-color: #bbf7d0; background: #f0fdf4; }
.card.atual { border: 2px solid var(--pri); }
.card.destaque { background: var(--pri); color: #fff; border: none; }
.card.alerta { background: var(--alerta-bg); border-color: #fecaca; color: #7f1d1d; }
.card.alerta strong { display: flex; align-items: center; gap: 6px; }
.alerta-leve { background: #fffbeb; border-color: #fde68a; }
.aviso-forte { background: #fffbeb; border-color: #fde68a; }
.ciencia { background: #f0fdfa; border-color: var(--pri-claro); }
.upsell { border: 2px dashed var(--acento); background: #fffbeb; }
.aviso { font-size: .8rem; color: var(--mute); text-align: center; margin: 20px 0 0; }
.mini { font-size: .85rem; color: var(--mute); }
.grande { font-size: 1.15rem; font-weight: 700; }
.reps { font-size: 2rem; font-weight: 800; color: var(--pri); margin: 4px 0 14px; }
.center { text-align: center; padding: 40px 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 50px; padding: 12px 18px; margin: 6px 0; border: 0; border-radius: 12px; background: var(--pri); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; }
.btn-sec { background: var(--pri-claro); color: var(--pri-esc); }
.btn-link { background: none; color: var(--mute); text-decoration: underline; font-weight: 400; min-height: 44px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }

label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=email], input[type=text], input:not([type]), input[inputmode], input[type=date], input[type=time], select, textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #d6d0c4; border-radius: 10px; font: inherit; background: #fff; color: var(--txt); }
textarea { min-height: 90px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 12px 0; }
legend { font-weight: 600; margin-bottom: 4px; }
.opcao { display: flex; align-items: center; gap: 10px; font-weight: 400; padding: 10px 12px; border: 1px solid var(--linha); border-radius: 10px; margin: 6px 0; background: #fff; min-height: 48px; }
.opcao input { width: 20px; height: 20px; accent-color: var(--pri); }
.erro { color: var(--alerta); font-weight: 600; min-height: 1.2em; }
.msg { margin-top: 10px; }

.checks { list-style: none; padding: 0; margin: 0; }
.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; margin: 0; padding: 10px 0; cursor: pointer; min-height: 44px; border-bottom: 1px solid #f1ede6; }
.checks li:last-child .check { border-bottom: 0; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { flex: 0 0 26px; height: 26px; border: 2px solid #cfc8bb; border-radius: 8px; display: grid; place-items: center; color: transparent; background: #fff; transition: .15s; }
.check input:checked + .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.check input:focus-visible + .box { outline: 3px solid var(--acento); outline-offset: 2px; }
.check input:checked ~ span:last-child { color: var(--mute); }

.semana-tag { font-size: .85rem; font-weight: 700; color: var(--pri); margin-bottom: 12px; }
.barra { height: 8px; border-radius: 99px; background: var(--pri-claro); margin-top: 6px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--pri); border-radius: 99px; }
.fase { margin-top: 18px; color: var(--pri-esc); }
.titulo-licao { font-size: 1.45rem; }
.objetivo { font-size: 1.05rem; color: var(--mute); }
.licao p { font-size: 1.04rem; line-height: 1.7; }
.citacao { margin: 16px 0; padding: 14px 16px; border-left: 4px solid var(--acento); background: #fff; border-radius: 0 12px 12px 0; }
.citacao blockquote { margin: 0; font-style: italic; font-size: 1.02rem; }
.citacao figcaption { font-size: .75rem; color: var(--mute); margin-top: 6px; }
.nav-semanas { display: flex; gap: 10px; } .nav-semanas > * { flex: 1; }

.lista-ex { padding-left: 18px; margin: 4px 0 10px; font-size: .95rem; }
.lista-simples { padding-left: 20px; }
.lista-simples li, ol li { margin-bottom: 6px; }
details { margin: 10px 0; }
summary { cursor: pointer; font-weight: 700; color: var(--pri); min-height: 44px; display: flex; align-items: center; }
.timer { text-align: center; padding: 20px 0; }
.timer-num { font-size: 4.5rem; font-weight: 800; color: var(--pri); font-variant-numeric: tabular-nums; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; scrollbar-width: none; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--linha); color: var(--txt); text-decoration: none; font-size: .9rem; min-height: 40px; display: flex; align-items: center; }
.chip.ativa { background: var(--pri); color: #fff; border-color: var(--pri); }
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.grade .card { margin: 0; }
.refeicoes { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.refeicoes dt { font-weight: 700; color: var(--pri); }
.refeicoes dd { margin: 0; }
.tabela-wrap { overflow-x: auto; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: .9rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--linha); vertical-align: top; }
th { background: #f5f1ea; }

.slider { margin: 14px 0; }
.slider output { color: var(--pri); font-weight: 800; font-size: 1.2rem; }
input[type=range] { width: 100%; accent-color: var(--pri); min-height: 36px; }
.grafico { width: 100%; height: auto; }
.grafico .grade-l { stroke: var(--linha); }
.grafico .eixo { font-size: 10px; fill: var(--mute); }
.grafico .linha { fill: none; stroke: var(--pri); stroke-width: 2.5; }
.grafico .ponto { fill: var(--acento); }

.qr { width: 220px; height: 220px; image-rendering: pixelated; display: block; margin: 8px auto; }
.pix-code { font-size: .75rem; word-break: break-all; }
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal-box { position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; background: var(--bg); border-radius: 18px 18px 0 0; padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); }
.modal-x { position: absolute; top: 6px; right: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 1.8rem; color: var(--mute); cursor: pointer; }
.spinner { width: 36px; height: 36px; margin: 0 auto 12px; border: 4px solid var(--pri-claro); border-top-color: var(--pri); border-radius: 50%; animation: gira 0.9s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 30; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }

.entrar .logo, .logo { font-size: 1.6rem; text-align: center; margin: 24px 0 18px; color: var(--txt); }
.logo b { color: var(--pri); margin-left: 6px; }

.so-print { display: none; }
.relatorio .pre { white-space: pre-wrap; }
@media print {
  .topo, .abas, .so-tela, #toast { display: none !important; }
  .so-print { display: block; }
  body { background: #fff; font-size: 12pt; }
  .conteudo { padding: 0; max-width: none; }
  .card { box-shadow: none; }
  .relatorio h3 { margin-top: 14pt; }
}

/* ---- v2 ---- */
.passos { display: flex; gap: 6px; margin: 0 0 6px; }
.passos i { flex: 1; height: 6px; border-radius: 99px; background: var(--pri-claro); }
.passos i.on { background: var(--pri); }
.opcao-btn { justify-content: flex-start; }
.card.destaque-claro, p.destaque-claro { background: #f0fdfa; border-color: #99f6e4; }
.card.futura { opacity: .75; }
.btn-sos { background: #9a3412; color: #fff; }
.btn-sos.grande { min-height: 60px; font-size: 1.1rem; margin-bottom: 12px; }
.btn-peq { min-height: 44px; padding: 8px 12px; width: auto; }
.link-inline { background: none; border: 0; padding: 0 2px; color: var(--pri); text-decoration: underline; font: inherit; cursor: pointer; min-height: 32px; }
.cuidado { margin-top: 10px; border-top: 1px solid #f1ede6; padding-top: 8px; }
.bolinhas { display: flex; gap: 8px; margin: 4px 0 6px; }
.bolinhas i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ok); }
.bolinhas i.cheia { background: var(--ok); }
.bolinhas i.futura { border-color: var(--linha); border-style: dashed; }
.refeicoes-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0; }
.ref-cel { display: flex; flex-direction: column; gap: 2px; }
.ref-btn { min-height: 64px; border-radius: 12px; border: 2px solid #cfc8bb; background: #fff; color: var(--txt); font: inherit; padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; -webkit-touch-callout: none; user-select: none; }
.ref-btn span, .ref-btn small { font-size: .74rem; color: var(--mute); text-align: center; line-height: 1.2; }
.ref-btn.e1 { border-color: var(--acento); background: #fffbeb; }
.ref-btn.e2 { border-color: var(--ok); background: #f0fdf4; }
.ref-btn.e2 span { color: var(--ok); font-weight: 700; }
.ref-oque { background: none; border: 0; color: var(--pri); text-decoration: underline; font: inherit; font-size: .8rem; min-height: 32px; cursor: pointer; }
.nota-rapida { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; }
.nota-rapida button { min-height: 44px; border: 1px solid #cfc8bb; background: #fff; border-radius: 8px; font: inherit; font-size: .85rem; padding: 0; color: var(--txt); }
.nota-rapida button.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.grafico .linha-2 { fill: none; stroke: #b45309; stroke-width: 2.5; stroke-dasharray: 6 4; }
.grafico .ponto-2 { fill: #b45309; }
.grafico .linha-neutra { fill: none; stroke: #475569; stroke-width: 2.5; }
.grafico .ponto-neutro { fill: #475569; }
.grafico .barra { fill: var(--pri); }
.grafico .barra-vazia { fill: var(--linha); }
.ex-imgs { display: flex; gap: 8px; justify-content: center; margin: 8px 0 12px; }
.ex-imgs img { width: 48%; max-width: 180px; height: auto; background: #fff; border: 1px solid var(--linha); border-radius: 12px; }
.missoes { padding-left: 0; list-style: none; margin: 0; }
.missao { border-bottom: 1px solid #f1ede6; padding: 10px 0; }
.missao:last-child { border-bottom: 0; }
.missao.feita .missao-txt { color: var(--mute); }
.missao .ok, .auto.ok { color: var(--ok); font-weight: 700; }
.auto { font-size: .92rem; margin: 6px 0; }
.contador { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.contador-btns { display: flex; align-items: center; gap: 8px; }
.contador-btns .btn { width: 48px; margin: 0; font-size: 1.3rem; }
.contador-btns output { min-width: 56px; text-align: center; font-weight: 700; }
.lista-campos input { margin: 4px 0; }
.lista-campos .rotulo { font-weight: 600; margin: 8px 0 2px; }
.dias-semana { display: flex; flex-wrap: wrap; gap: 6px; }
.dias-semana .chip { min-height: 44px; cursor: pointer; font: inherit; }
.chips button.chip { cursor: pointer; font: inherit; }
.botoes-linha { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.botoes-linha .btn { font-size: .9rem; padding: 8px 6px; }
.botoes-linha .btn[aria-pressed=true] { background: var(--pri); color: #fff; }
.escolha-forca { margin: 14px 0; }
.lista-escolha { list-style: none; padding: 0; }
.linha-form { display: flex; gap: 8px; align-items: center; }
.linha-form .btn { width: auto; white-space: nowrap; }
.preco { color: var(--mute); }
.sug { color: var(--pri-esc); }
.grande-lista li { font-size: 1.05rem; margin-bottom: 10px; }
.sos-rodape { margin-top: 18px; font-size: .9rem; }
.mini-det summary { font-size: .9rem; }
.resumo ul { margin: 4px 0 8px; }
@media print { .so-print.oculto { display: none; } .relatorio .card { border: 0; padding: 0; } .relatorio details { display: block; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* Proteína: botões − e + (sem toque longo) */
.ref-lista { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.ref-linha { display: grid; grid-template-columns: 1fr 44px 44px auto; align-items: center; gap: 6px; border: 2px solid #cfc8bb; border-radius: 12px; padding: 4px 6px 4px 10px; background: #fff; }
.ref-linha.e1 { border-color: var(--acento); background: #fffbeb; }
.ref-linha.e2 { border-color: var(--ok); background: #f0fdf4; }
.ref-nome { display: flex; flex-direction: column; line-height: 1.2; }
.ref-nome span, .ref-nome small { font-size: .8rem; color: var(--mute); }
.ref-linha.e2 .ref-nome span { color: var(--ok); font-weight: 700; }
.ref-menos, .ref-mais { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--pri); background: #fff; color: var(--pri); font-size: 1.4rem; font-weight: 700; line-height: 1; cursor: pointer; }
.ref-mais { background: var(--pri); color: #fff; }
.ref-menos:disabled, .ref-mais:disabled { opacity: .35; cursor: default; }
.ref-linha .ref-oque { min-height: 44px; }
/* Hoje: "Mais desta semana" recolhido */
.mais-semana { border: 1px dashed #cfc8bb; border-radius: 12px; padding: 0 12px; }
.mais-semana[open] { padding-bottom: 8px; }
.rotulo-secao { margin: 14px 0 4px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }

/* ---- rodada final ---- */
/* Tabelas de histórico: rótulos curtos na tela (cabem em 360 px), completos na impressão. */
.tab-hist .longo { display: none; }
.tab-hist abbr { text-decoration: none; }
.tab-hist th, .tab-hist td { padding: 7px 5px; white-space: nowrap; }
.tab-hist td:last-child { white-space: normal; }
@media (max-width: 420px) { .tab-hist { font-size: .82rem; } .tab-hist th, .tab-hist td { padding: 6px 4px; } }
@media print { .tab-hist .curto { display: none; } .tab-hist .longo { display: inline; } .tab-hist { font-size: 10pt; } .tab-hist th, .tab-hist td { white-space: normal; padding: 4pt; } }
/* Exercício com movimento: alterna os 2 quadros (~1,2 s cada); com movimento reduzido, lado a lado. */
.ex-imgs.anim { position: relative; display: block; width: 200px; max-width: 70%; aspect-ratio: 1; margin: 8px auto 12px; }
.ex-imgs.anim img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.ex-imgs.anim img + img { animation: ex-quadro 2.4s ease-in-out infinite; }
@keyframes ex-quadro { 0%, 42% { opacity: 0; } 50%, 92% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ex-imgs.anim { display: flex; gap: 8px; justify-content: center; position: static; width: auto; max-width: none; aspect-ratio: auto; }
  .ex-imgs.anim img { position: static; width: 48%; max-width: 180px; height: auto; opacity: 1; }
}
.fontes-lista li { margin-bottom: 8px; }
.google-btn { min-height: 48px; display: flex; justify-content: center; margin: 10px 0; }

/* Atalhos em ícone na Hoje (grade de 4) e "continuar treino" */
.atalhos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.atalho { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 64px; padding: 6px 2px; color: var(--txt); text-decoration: none; font-size: .78rem; font-weight: 600; text-align: center; line-height: 1.2; border-radius: 12px; }
.atalho-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--pri-claro); color: var(--pri-esc); }
.atalho-sos .atalho-ic { background: #9a3412; color: #fff; }
.atalho:active .atalho-ic { transform: scale(.94); }
.card.continuar { border: 2px solid var(--pri); }
.card.continuar h3 { display: flex; align-items: center; gap: 6px; color: var(--pri-esc); }
