:root {
  color-scheme: light dark;
  --display: "Futura", "Futura PT", "Century Gothic", "Avenir Next", "Trebuchet MS", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --bg: #E6E7E9;
  --app-bg: #F0F1F3;
  --card: #FFFFFF;
  --card-2: #F4F5F6;
  --ink: #17191E;
  --ink-2: #454951;
  --muted: #767B84;
  --line: #E1E3E7;
  --line-2: #ECEEF0;
  --accent: #D23A28;
  --accent-ink: #B12F1F;
  --accent-wash: #F7E4E0;
  --p-dieta: #2F7A66;
  --p-agua: #1B7FA8;
  --p-telas: #6B4E9E;
  --p-treino: #C24A2E;
  --p-sono: #3A4E85;
  --frame: #0a0b0d;
  --cover: #14161A;
  --cover-fg: #F3F3F2;
  --cover-fg2: #9DA0A7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0C0F; --app-bg: #101216; --card: #191C21; --card-2: #212530;
    --ink: #ECEDEF; --ink-2: #B6B9C0; --muted: #7E828B; --line: #2A2E36; --line-2: #23262E;
    --accent: #EF5A44; --accent-ink: #F2705C; --accent-wash: #2A1713;
    --p-dieta: #4CA089; --p-agua: #52B6DC; --p-telas: #A98BD6; --p-treino: #E5714F; --p-sono: #7089C6;
    --cover: #0C0D10; --cover-fg: #F3F3F2; --cover-fg2: #90939B;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.app {
  position: relative; width: 100%; max-width: 480px; margin: 0 auto;
  min-height: 100dvh; background: var(--app-bg); overflow: hidden;
  box-shadow: 0 0 60px -20px rgba(0,0,0,.25);
}
.screen { display: none; flex-direction: column; min-height: 100dvh; }
.screen.active { display: flex; }

/* ---------- config banner ---------- */
.config-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--accent); color: #fff; font-size: .82rem; line-height: 1.4;
  padding: 10px 16px; text-align: center;
}
.config-banner code { font-family: var(--mono); background: rgba(0,0,0,.18); padding: 1px 5px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 15px; border-radius: 11px; font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-size: .92rem; font-weight: 600; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.gmark { width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: .82rem; }

/* ---------- ENTRAR ---------- */
#scr-entrar { background: var(--cover); }
.enter { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: max(34px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom)); }
.brand { margin-top: 40px; }
.brand .k { font-family: var(--mono); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.brand h1 { font-family: var(--display); text-transform: uppercase; color: var(--cover-fg); font-size: clamp(3rem, 14vw, 3.6rem); line-height: .92; letter-spacing: .01em; margin: 16px 0 0; }
.brand h1 .r { color: var(--accent); }
.brand p { color: var(--cover-fg2); margin: 20px 0 0; font-size: 1.05rem; line-height: 1.5; }
.enter-actions { display: flex; flex-direction: column; gap: 11px; }
.fine { text-align: center; font-size: .7rem; color: var(--cover-fg2); line-height: 1.5; margin: 8px 0 0; }

/* ---------- top bar ---------- */
.topbar { flex: none; display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 18px 12px; }
.topbar .ttl { flex: 1; }
.topbar .ttl h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: .03em; font-size: 1.3rem; margin: 0; line-height: 1.1; }
.topbar .ttl .sub { font-family: var(--mono); font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.avatar { width: 42px; height: 42px; border-radius: 11px; background: var(--accent); color: #fff; font-family: var(--display); font-weight: 700; font-size: 1.15rem; display: grid; place-items: center; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.content { flex: 1; overflow-y: auto; padding: 6px 18px 28px; }
.greet { font-family: var(--display); font-size: 1.8rem; text-transform: uppercase; letter-spacing: .01em; margin: 4px 0 18px; }
.greet .em { color: var(--accent); }

.h-eyebrow { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.found-card { background: var(--cover); color: var(--cover-fg); border-radius: 13px; padding: 20px; }
.found-card p { margin: 10px 0 0; font-size: .92rem; line-height: 1.55; color: var(--cover-fg2); }
.found-card p b { color: var(--cover-fg); }
.found-card .who { margin-top: 14px; font-family: var(--mono); font-size: .74rem; color: var(--cover-fg2); border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; word-break: break-all; }

.preview-lbl { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 24px 0 10px; }

.pillar { display: flex; align-items: center; gap: 13px; padding: 15px; margin-bottom: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, transform .06s; }
.pillar:active { transform: scale(.995); border-color: var(--c); }
.pillar:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.pillar .ci { width: 40px; height: 40px; border: 1.5px solid var(--c); border-radius: 10px; display: grid; place-items: center; color: var(--c); flex: none; }
.pillar .ci svg { width: 21px; height: 21px; }
.pillar .tx { flex: 1; }
.pillar .tx b { display: block; font-family: var(--display); font-size: 1.05rem; letter-spacing: .01em; }
.pillar .tx span { font-size: .8rem; color: var(--muted); }
.pillar .chk { width: 27px; height: 27px; border-radius: 8px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.pillar .chk svg { width: 15px; height: 15px; color: #fff; opacity: 0; }
.pillar .chk.on { background: var(--c); border-color: var(--c); }
.pillar .chk.on svg { opacity: 1; }
.pillar .chk.partial { border-color: var(--c); }
.pillar .chk.partial::after { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--c); }

/* ---------- loader ---------- */
#scr-load { align-items: center; justify-content: center; }
.loader { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted); font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.spin { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.5s; } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); background: var(--cover); color: var(--cover-fg); font-family: var(--mono); font-size: .76rem; padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; max-width: 90%; text-align: center; box-shadow: 0 12px 34px -12px rgba(0,0,0,.5); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Selo de superadmin — só aparece quando o Firestore confirma a permissão. */
.found-card .papel {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
}


/* ---------- resumo do dia (passo 01) ---------- */
.today-sum { margin-top: 14px; padding: 16px; border-radius: 13px; background: var(--cover); color: var(--cover-fg); }
.today-sum .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.today-sum .pts { font-family: var(--display); font-size: 2rem; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.today-sum .pts small { font-size: .9rem; color: var(--cover-fg2); }
.today-sum .stat { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--cover-fg2); text-align: right; max-width: 14ch; }
.today-sum .stat.done { color: var(--accent); font-weight: 700; }
.segs { display: flex; gap: 6px; margin-top: 14px; }
.segs i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.16); display: block; transition: background .2s; }
.segs i.on { background: var(--accent); }
.today-sum .sync { margin-top: 10px; font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cover-fg2); }

/* sequência no topo */
.streak { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-weight: 700; font-size: .78rem; color: var(--accent); background: var(--accent-wash); padding: 6px 10px; border-radius: 8px; flex: none; font-variant-numeric: tabular-nums; }
.streak svg { width: 13px; height: 13px; }

@media (prefers-reduced-motion: reduce) {
  .pillar, .pillar .chk, .segs i { transition: none; }
  .pillar:active { transform: none; }
}

/* ---------- navegação e tropas (passo 02) ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); display: flex; z-index: 30; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); background: none; border: none; font: inherit; cursor: pointer; }
.tabbar button svg { width: 21px; height: 21px; }
.tabbar button span { font-family: var(--mono); font-size: .6rem; letter-spacing: .04em; text-transform: uppercase; }
.tabbar button.on { color: var(--accent); }
.tabspace { height: 78px; }

.topbar .back { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; display: grid; place-items: center; background: var(--card); color: inherit; cursor: pointer; flex: none; }
.topbar .back svg { width: 18px; height: 18px; }

.row-btns { display: flex; gap: 10px; margin-bottom: 16px; }
.row-btns .btn { flex: 1; }
.btn.sm { padding: 12px; font-size: .82rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 16px; margin-bottom: 14px; }
.code { display: flex; align-items: center; justify-content: center; background: var(--card-2, var(--bg)); border: 1px dashed var(--line); border-radius: 9px; padding: 14px; margin: 10px 0; }
.code .c { font-family: var(--mono); font-weight: 700; font-size: 1.3rem; letter-spacing: .16em; color: var(--ink); }

.tropa { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 16px; margin-bottom: 11px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; font: inherit; color: inherit; cursor: pointer; }
.tropa .tx { flex: 1; min-width: 0; }
.tropa .tx b { display: block; font-family: var(--display); font-size: 1.12rem; text-transform: uppercase; letter-spacing: .01em; }
.tropa .tx span { font-family: var(--mono); font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tropa .chev svg { width: 18px; height: 18px; color: var(--muted); }

.lead { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--card); }
.lead .lr { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.lead .lr:last-child { border-bottom: none; }
.lead .lr.me { background: var(--accent-wash); }
.lead .pos { font-family: var(--mono); font-weight: 700; font-size: .85rem; color: var(--muted); width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.lead .lr.me .pos { color: var(--accent); }
.lead .av { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: .8rem; flex: none; overflow: hidden; }
.lead .av img { width: 100%; height: 100%; object-fit: cover; }
.lead .nm { flex: 1; font-family: var(--display); font-size: .98rem; min-width: 0; }
.lead .nm small { display: block; font-family: var(--mono); font-size: .62rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.lead .pt { font-family: var(--mono); font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.lead .pt small { display: block; font-weight: 400; color: var(--muted); font-size: .6rem; text-align: right; }

.vazio { text-align: center; color: var(--muted); font-size: .9rem; padding: 30px 10px; line-height: 1.6; }

.inv-hero { text-align: center; padding: 40px 0 24px; }
.inv-hero .from { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.inv-hero .who-inv { font-family: var(--display); font-size: 1.9rem; text-transform: uppercase; letter-spacing: .01em; margin: 10px 0; }
.inv-hero .who-inv b { color: var(--accent); }
.inv-hero .grp { display: inline-block; font-family: var(--display); font-size: 1.2rem; text-transform: uppercase; border: 1px solid var(--line); border-radius: 9px; padding: 10px 16px; margin-top: 6px; }

/* ---------- desafio (passo 03) ---------- */
.chal { background: var(--cover); color: var(--cover-fg); border-radius: 13px; padding: 18px; margin-bottom: 14px; }
.chal .h-eyebrow { color: var(--accent); }
.chal h3 { font-family: var(--display); text-transform: uppercase; font-size: 1.3rem; margin: 8px 0 4px; letter-spacing: .01em; }
.chal .day { font-family: var(--mono); font-size: .74rem; color: var(--cover-fg2); }
.chal-bar { height: 7px; background: rgba(255,255,255,.15); border-radius: 4px; margin-top: 14px; overflow: hidden; }
.chal-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.chal .btn.ghost { background: transparent; border-color: rgba(255,255,255,.22); color: var(--cover-fg); }

.preset { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; margin-bottom: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font: inherit; color: inherit; cursor: pointer; }
.preset:last-child { margin-bottom: 0; }
.preset b { font-family: var(--display); font-size: 1rem; }
.preset span { font-family: var(--mono); font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.regra { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.regra:last-child { border-bottom: none; }
.regra .sq { width: 32px; height: 32px; border: 1.5px solid var(--c); border-radius: 9px; display: grid; place-items: center; color: var(--c); flex: none; }
.regra .sq svg { width: 17px; height: 17px; }
.regra .tx b { display: block; font-family: var(--display); font-size: .96rem; }
.regra .tx span { font-size: .8rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { .chal-bar i { transition: none; } }

/* ---------- formulário de e-mail e senha ---------- */
.campo { margin-bottom: 14px; }
.campo label { display: block; font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.campo input { width: 100%; padding: 14px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 11px; }
.campo input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.campo input:autofill { -webkit-text-fill-color: var(--ink); }
.campo .dica { display: block; margin-top: 6px; font-size: .74rem; color: var(--muted); }

.erro { background: var(--accent-wash); color: var(--accent-ink, var(--accent)); border: 1px solid var(--accent); border-radius: 10px; padding: 12px 14px; font-size: .86rem; margin: 0 0 14px; }

.link { display: block; width: 100%; background: none; border: none; font: inherit; font-size: .84rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px; }
.link:hover { color: var(--ink); }

#scr-email .content { padding-top: 8px; }

/* ---------- indicador de nível (enche conforme o registro) ---------- */
/* Oito copos enchem o copo; quatro enchem pela metade. O desenho fala
   antes do texto — vale para todos os pilares graduados. */
.pillar .nivel {
  width: 27px; height: 27px; border-radius: 8px; flex: none;
  border: 2px solid var(--line);
  display: flex; align-items: flex-end; overflow: hidden;
  transition: border-color .15s;
}
.pillar .nivel i {
  display: block; width: 100%; height: 0;
  background: var(--c);
  transition: height .22s ease-out;
}
.pillar .nivel[data-n="1"] { border-color: var(--c); }
.pillar .nivel[data-n="2"] { border-color: var(--c); }
.pillar .nivel[data-n="3"] { border-color: var(--c); }
.pillar .nivel[data-n="1"] i { height: 28%; }
.pillar .nivel[data-n="2"] i { height: 62%; }
.pillar .nivel[data-n="3"] i { height: 100%; }

/* ---------- histórico ---------- */
.dia-linha {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 15px; margin-bottom: 9px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  font: inherit; color: inherit; cursor: pointer;
}
.dia-linha .quando { flex: 1; min-width: 0; }
.dia-linha .quando b { display: block; font-family: var(--display); font-size: 1rem; letter-spacing: .01em; }
.dia-linha .quando span { font-family: var(--mono); font-size: .64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dia-linha .atraso { color: var(--accent); }
.dia-linha .pontos { font-family: var(--mono); font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; }
.dia-linha .pontos small { display: block; font-weight: 400; color: var(--muted); font-size: .58rem; text-align: right; }

/* mini-barras: um traço por pilar, altura = nível */
.mini-niveis { display: flex; align-items: flex-end; gap: 3px; height: 22px; flex: none; }
.mini-niveis i { width: 5px; border-radius: 2px; background: var(--line); display: block; height: 3px; }
.mini-niveis i[data-n="1"] { height: 7px; }
.mini-niveis i[data-n="2"] { height: 14px; }
.mini-niveis i[data-n="3"] { height: 22px; }

.aviso { background: var(--accent-wash); border: 1px solid var(--accent); border-radius: 11px; padding: 13px 15px; font-size: .84rem; line-height: 1.5; margin-bottom: 16px; }

@media (prefers-reduced-motion: reduce) { .pillar .nivel i { transition: none; } }

/* ---------- navegação por mês no histórico ---------- */
.mes-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mes-nav button { width: 36px; height: 36px; flex: none; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: inherit; display: grid; place-items: center; cursor: pointer; }
.mes-nav button:disabled { opacity: .35; cursor: default; }
.mes-nav button svg { width: 18px; height: 18px; }
.mes-nav b { flex: 1; text-align: center; font-family: var(--display); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .02em; }

.mes-resumo { display: flex; gap: 8px; margin-bottom: 14px; }
.mes-resumo div { flex: 1; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 11px 6px; }
.mes-resumo .v { font-family: var(--display); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.mes-resumo .k { font-family: var(--mono); font-size: .58rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 3px; line-height: 1.3; }

.ir-data { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 10px 14px; margin-bottom: 16px; }
.ir-data label { font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ir-data input { border: none; background: none; font: inherit; font-size: .92rem; color: var(--ink); text-align: right; }
.ir-data input:focus { outline: none; color: var(--accent); }

.conv-desafio { margin-top: 14px; font-family: var(--mono); font-size: .78rem; color: var(--accent); letter-spacing: .03em; }

/* ---------- duração livre do desafio ---------- */
.livre { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.livre label { display: block; font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.livre-linha { display: flex; gap: 8px; }
.livre-linha input { flex: 1; min-width: 0; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-variant-numeric: tabular-nums; }
.livre-linha input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.preset .fim { display: block; font-family: var(--mono); font-size: .62rem; color: var(--muted); text-transform: none; letter-spacing: .02em; margin-top: 2px; }

/* ---------- zona de risco ---------- */
.zona-perigo { margin-top: 26px; padding: 16px; border: 1px solid var(--accent); border-radius: 13px; background: var(--accent-wash); }
.zona-perigo .lbl { color: var(--accent); }
.zona-perigo p { font-size: .84rem; line-height: 1.55; margin: 10px 0 0; color: var(--ink-2); }
.zona-perigo p.ok { color: var(--muted); font-size: .8rem; }
.zona-perigo .btn { margin-top: 14px; }
.btn.perigo { background: var(--accent); color: #fff; }
.btn.perigo:disabled { opacity: .6; }

/* ---------- perfil e medidas ---------- */
.perfil-topo { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.av-grande { width: 62px; height: 62px; border-radius: 15px; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.7rem; flex: none; overflow: hidden; }
.av-grande img { width: 100%; height: 100%; object-fit: cover; }
.pf-nome { min-width: 0; }
.pf-nome b { display: block; font-family: var(--display); font-size: 1.3rem; text-transform: uppercase; letter-spacing: .01em; }
.pf-nome span { display: block; font-size: .84rem; color: var(--muted); word-break: break-all; }

.privado { display: flex; gap: 11px; align-items: flex-start; margin: 18px 0 4px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.privado svg { width: 19px; height: 19px; color: var(--accent); flex: none; margin-top: 1px; }
.privado span { font-size: .81rem; line-height: 1.5; color: var(--muted); }
.privado b { color: var(--ink); }

.md-par { display: flex; gap: 10px; }
.md-par .campo { flex: 1; min-width: 0; }
.campo .un { position: relative; }
.campo .un input { padding-right: 42px; }
.campo .un i { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: .72rem; color: var(--muted); font-style: normal; }

.md-linha { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 15px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font: inherit; color: inherit; cursor: pointer; }
.md-linha .q { flex: 1; font-family: var(--display); font-size: .98rem; }
.md-linha .q small { display: block; font-family: var(--mono); font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.md-linha .v { font-family: var(--mono); font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; }

.variacao { display: flex; align-items: baseline; gap: 10px; }
.variacao .n { font-family: var(--display); font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.variacao .n.sobe { color: var(--p-treino); }
.variacao .n.desce { color: var(--p-dieta); }
.variacao .d { font-size: .8rem; color: var(--muted); line-height: 1.45; }

.lead .lr .lider { font-family: var(--mono); font-size: .55rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); background: var(--accent-wash); border-radius: 5px; padding: 2px 6px; margin-left: 6px; vertical-align: middle; }

/* botão de remover membro, visível só para quem lidera */
.lead .lr .tirar { width: 28px; height: 28px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.lead .lr .tirar:hover { border-color: var(--accent); color: var(--accent); }
.lead .lr .tirar svg { width: 14px; height: 14px; }
.lead .lr .tirar:disabled { opacity: .4; cursor: default; }

/* ---------- mostrar/ocultar senha ---------- */
.campo .com-olho { position: relative; display: block; }
/* espaço à direita para o botão não cobrir o que está sendo digitado */
.campo .com-olho input { padding-right: 48px; }
.campo .com-olho button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  background: none; border: none; border-radius: 8px;
  color: var(--muted); cursor: pointer;
}
.campo .com-olho button:hover { color: var(--ink); }
.campo .com-olho button[aria-pressed="true"] { color: var(--accent); }
.campo .com-olho button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.campo .com-olho button svg { width: 20px; height: 20px; }

/* ---------- escolha da duração (selecionar, depois salvar) ---------- */
.preset { transition: border-color .15s, background .15s; }
.preset.on { border-color: var(--accent); background: var(--accent-wash); }
.preset.on b { color: var(--accent-ink, var(--accent)); }
.preset .marca { width: 20px; height: 20px; flex: none; border: 2px solid var(--line); border-radius: 50%; display: grid; place-items: center; }
.preset.on .marca { border-color: var(--accent); }
.preset.on .marca::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.preset .corpo { flex: 1; min-width: 0; }

.livre input { width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-variant-numeric: tabular-nums; }
.livre input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }

.resumo-escolha { margin: 16px 0 10px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; font-family: var(--mono); font-size: .76rem; color: var(--muted); text-align: center; line-height: 1.5; }
.resumo-escolha.pronto { border-style: solid; border-color: var(--accent); color: var(--ink); }
.resumo-escolha b { color: var(--accent); }

/* ---------- mensagem do convite ---------- */
#txt-convite {
  width: 100%; padding: 14px; font: inherit; font-size: .88rem; line-height: 1.55;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 11px; resize: vertical;
}
#txt-convite:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }

.btn.zap { background: #25D366; color: #08301A; }
.btn.zap svg { width: 20px; height: 20px; }

/* ---------- trava de liderança, imposta pelo CSS ----------
   Oito atributos `hidden` em JavaScript são frágeis: basta um caminho de
   erro, um retorno antecipado ou um arquivo velho em cache para vazar um
   controle de administração para quem não lidera.

   Aqui a regra é uma só e mora fora do JavaScript. Sem a classe `eh-lider`
   no #app, TUDO que estiver marcado com data-lider desaparece — mesmo que
   algum código depois mande mostrar. Falha fechada, não aberta. */
#app:not(.eh-lider) [data-lider] { display: none !important; }

/* ---------- manutenção ---------- */
.manutencao { margin-top: 26px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.manutencao p { font-size: .82rem; line-height: 1.5; color: var(--muted); margin: 10px 0 14px; }
.manutencao .versao { margin-top: 12px; font-family: var(--mono); font-size: .68rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.manutencao .versao b { color: var(--ink); }

/* ---------- pontuação dentro de "o que conta no dia" ---------- */
.regra .tx .pontos-pilar { display: block; margin-top: 3px; font-family: var(--mono); font-size: .66rem; font-style: normal; color: var(--c); letter-spacing: .02em; }
.regras-rodape { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.regras-rodape .soma { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; font-size: .86rem; color: var(--ink-2); }
.regras-rodape .soma b { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.regras-rodape .soma.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.regras-rodape .soma.total b { color: var(--accent); font-size: 1.05rem; }
.regras-rodape .atrasado { margin: 14px 0 0; padding: 12px 14px; background: var(--accent-wash); border-radius: 10px; font-size: .8rem; line-height: 1.55; color: var(--ink-2); }
.regras-rodape .atrasado b { color: var(--accent-ink, var(--accent)); }
