/* Início e o que só o app tem: entrada, mensagens, cabeçalho, previsões, som para dormir e a roldana da mamada.
   As peças comuns (botões, cartões, chips, janela de baixo, abas, Dormiu/Acordou, números) vêm de components.css. */

/* ---------- Casca ---------- */
.app.is-enter { padding-bottom: calc(24px + var(--safe-bottom)); }

/* No iPhone instalado a barra de status (black-translucent) tem letras brancas: no tema claro, uma faixa escura atrás delas. */
@media (display-mode: standalone) {
  :root[data-theme="light"] body::before { content: ""; position: fixed; inset: 0 0 auto; height: var(--safe-top); background: var(--text); z-index: 30; }
}

/* ---------- Entrada (e-mail e código) e mensagens ---------- */
.enter { min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 40px); display: grid; align-content: center; justify-items: center; gap: 12px; text-align: center; padding: 16px 0; }
.enter-art { width: 144px; height: 144px; border-radius: 34px; box-shadow: var(--glow-sleep); }
.enter-title { margin: 10px 0 0; line-height: 1; }
.enter .page-title { margin: 8px 0 0; }
.enter-sub { margin: 0; color: var(--muted); font-weight: 700; }
.enter-sub b { color: var(--text); font-weight: 900; overflow-wrap: anywhere; }
.enter-form { width: min(100%, 340px); display: grid; gap: 10px; margin-top: 14px; text-align: left; }
.enter-code { min-height: 58px; text-align: center; font-size: 26px; letter-spacing: .3em; }
.enter .field-err { min-height: 0; font-size: 14.5px; text-align: center; }
.enter-help { margin: 0; color: var(--muted); font-size: var(--fs-2); font-weight: 700; line-height: 1.4; text-align: center; }
.enter-help b { color: var(--text); font-weight: 900; }
.enter-foot { margin-top: 14px; }
.enter-foot a { color: var(--text); font-weight: 800; }
.enter-links { display: flex; justify-content: center; gap: 4px; }
.enter .hint { justify-content: center; }
.page-msg { min-height: 70dvh; display: grid; align-content: center; justify-items: center; gap: 16px; text-align: center; }
.page-msg img { width: 112px; height: 112px; border-radius: 28px; }
.page-msg p { margin: 0; max-width: 28ch; font-size: 17px; font-weight: 800; }

/* ---------- Primeira entrada (autorização da consultora e sobre o bebê) ---------- */
.page-primeira, .setup-form { flex: 1; }
.setup-form { display: flex; flex-direction: column; gap: 14px; }
.setup-stack { display: grid; gap: 12px; }
.setup-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.setup-lead { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; }
.setup-lead b { font-weight: 900; overflow-wrap: anywhere; }
.setup-help { margin: 0; color: var(--muted); font-size: var(--fs-2); font-weight: 700; line-height: 1.4; }
.setup-help a { color: var(--sleep); font-weight: 800; text-underline-offset: 3px; }
.setup-end { display: grid; gap: 10px; margin-top: auto; padding-top: 6px; text-align: center; }
.setup-end .field-err:empty { display: none; }
.page-primeira .page-title:focus { outline: none; }

/* ---------- Fim do período grátis: faixa do Início, mensagem e só leitura ---------- */
.trial-slot:empty { display: none; }
.trial-banner { width: 100%; text-align: left; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.3; cursor: pointer; }
.trial-banner b { color: var(--text); font-weight: 900; }
.trial-go { flex: none; margin-left: auto; padding: 9px 14px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: var(--fs-2); font-weight: 800; }
.home.is-locked :is(.pair, [data-act="feed"], [data-act="add-appt"]) { opacity: .36; filter: saturate(.35); }
.trial-msg { display: grid; gap: 14px; }
.trial-msg .mascot { width: 92px; height: 92px; justify-self: center; margin-bottom: -6px; }
.trial-msg > p { margin: -6px 0 0; }
.trial-price { display: grid; gap: 2px; justify-items: center; padding: 14px; text-align: center; }
.trial-price span { color: var(--muted); font-size: var(--fs-2); font-weight: 800; }
.trial-ticks { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0 4px; font-weight: 800; }
.trial-ticks li { display: flex; align-items: center; gap: 10px; }
.trial-ticks .ic { width: 18px; height: 18px; color: var(--ok); stroke-width: 3; }
.trial-msg .trial-small { margin: -4px 0 0; font-size: 13px; text-align: center; }

/* ---------- Início ---------- */
.page.home { flex: 1 0 auto; gap: 10px; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; }
.home-h1 { margin: 0; line-height: 1; }
.home-top-r { display: flex; align-items: center; gap: 8px; min-width: 0; }
.appt-chip { min-width: 0; background: var(--surface); border: 1px solid var(--line); }
.appt-chip .ic { color: var(--muted); }
.appt-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.appt-when { flex: none; }
@media (max-width: 400px) { /* celular estreito: sem o ícone, o nome do médico cabe inteiro */
  .appt-chip { gap: 4px; padding: 0 10px; }
  .appt-chip .ic { display: none; }
}

/* Som para dormir: linha de cartão mais baixa, com o chip e o botão de tocar à direita */
.noise { min-height: 58px; padding: 6px 7px 6px 16px; font-size: 15px; font-weight: 800; }
.noise > .ic { color: var(--muted); }
.noise-chip { margin-left: auto; }
.noise-chip:disabled { cursor: default; }
.play .ic { width: 18px; height: 18px; }

/* Previsões */
.next { display: grid; gap: 8px; padding: 2px 4px; }
.nx { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); font-size: 14.5px; font-weight: 600; }
.nx .ic { width: 18px; height: 18px; }
.nx b { color: var(--text); font-weight: 900; }

/* ---------- Janela da mamada ---------- */
.sides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sides .chip { justify-content: center; }
/* Roldana horizontal (wheel.js): a pílula do meio marca o valor; 56px por número, igual ao W do JS */
.wheel { position: relative; display: grid; justify-items: center; gap: 4px; }
.wheel::before { content: ""; position: absolute; top: 0; left: 50%; width: 76px; height: 60px; margin-left: -38px; border-radius: 18px; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--well); }
.wheel-track { position: relative; display: flex; width: 100%; height: 60px; overflow: hidden; touch-action: none; cursor: grab; padding-inline: calc(50% - 28px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); }
.wheel-track:focus-visible { outline: 2px solid var(--sleep); outline-offset: 2px; border-radius: 18px; }
.wheel-track span { flex: none; width: 56px; display: grid; place-items: center; font-size: 27px; font-weight: 900; font-variant-numeric: tabular-nums; opacity: .2; transform: scale(.55); cursor: pointer; user-select: none; -webkit-user-select: none; }
.wheel-unit { font-size: 13px; font-weight: 800; color: var(--muted); }
