/* Ninho · estilos */
:root {
  --off: #F8F6F1; --areia: #E9E1D5; --salvia: #A9B9A5; --salvia-esc: #7E9479; --terra: #C98F79;
  --azul: #A9BDCA; --grafite: #41433F; --suave: #7A7C76; --branco: #FFFFFF; --erro: #B4553F;
  --raio: 18px; --sombra: 0 2px 14px rgba(65, 67, 63, .07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Nunito', system-ui, sans-serif; background: var(--off); color: var(--grafite); line-height: 1.5; font-size: 16px; }
a { color: var(--salvia-esc); }
h1, h2, h3 { font-weight: 800; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Botões e formulários ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 22px;
  font-weight: 700; cursor: pointer; text-decoration: none; background: var(--grafite); color: var(--off); transition: opacity .15s; }
.btn:active { opacity: .8; } .btn:disabled { opacity: .5; cursor: default; }
.btn.salvia { background: var(--salvia-esc); color: #fff; } .btn.terra { background: var(--terra); color: #fff; }
.btn.claro { background: var(--areia); color: var(--grafite); } .btn.linha { background: transparent; border: 1.5px solid var(--areia); color: var(--grafite); }
.btn.perigo { background: transparent; color: var(--erro); border: 1.5px solid #E7C6BC; }
.btn.bloco { width: 100%; } .btn.peq { padding: 8px 14px; font-size: 14px; }
label { display: block; font-size: 14px; font-weight: 700; margin: 14px 0 6px; }
input, select, textarea { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--areia); background: var(--branco); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--salvia); }
textarea { resize: vertical; min-height: 80px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--salvia-esc); }
.erro { color: var(--erro); font-size: 14px; margin-top: 10px; min-height: 1em; }
.nota { font-size: 13px; color: var(--suave); }
.linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--areia); background: var(--branco); cursor: pointer; font-weight: 600; font-size: 14px; }
.chip.on { background: var(--salvia-esc); color: #fff; border-color: var(--salvia-esc); }

/* ---------- Estrutura do app ---------- */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding: 20px 18px 110px; }
.topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.logo { font-weight: 800; font-size: 24px; letter-spacing: -.5px; display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--grafite); }
.logo img { width: 32px; height: 32px; }
.card { background: var(--branco); border-radius: var(--raio); padding: 18px; box-shadow: var(--sombra); margin-bottom: 14px; }
.card h3 { font-size: 16px; margin-bottom: 6px; }
.rotulo { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--suave); }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.grade .card { margin: 0; }
.valor { font-size: 22px; font-weight: 800; }
.saud { font-size: 24px; margin-bottom: 4px; }
.bebe { display: flex; align-items: center; gap: 12px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--areia); display: grid; place-items: center; font-size: 24px; flex: none; }
.timer { background: linear-gradient(160deg, #C4D0C1, var(--salvia)); color: var(--grafite); text-align: center; padding: 26px 18px; }
.timer .tempo { font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.rapidos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.rapido { background: var(--branco); border: 0; border-radius: var(--raio); padding: 14px 6px; box-shadow: var(--sombra); cursor: pointer; font-weight: 700; font-size: 13px; }
.rapido span { display: block; font-size: 24px; margin-bottom: 4px; }

/* Navegação inferior */
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--areia);
  display: flex; justify-content: center; padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
.nav div { display: flex; width: 100%; max-width: 560px; justify-content: space-around; }
.nav a { text-decoration: none; color: var(--suave); font-size: 11px; font-weight: 700; text-align: center; padding: 4px 8px; border-radius: 12px; }
.nav a span { display: block; font-size: 22px; line-height: 1.2; filter: grayscale(1); opacity: .7; }
.nav a.on { color: var(--grafite); } .nav a.on span { filter: none; opacity: 1; }

/* Lista de registros */
.reg { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--off); cursor: pointer; }
.reg:last-child { border-bottom: 0; }
.reg .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; flex: none; }
.ic.sono { background: #E3E9E1; } .ic.mama { background: #F3E3DC; } .ic.desp { background: #E1E9EE; }
.reg .txt { flex: 1; min-width: 0; } .reg .txt b { display: block; font-size: 15px; } .reg .txt small { color: var(--suave); font-size: 13px; }
.reg .hora { font-weight: 700; font-size: 14px; white-space: nowrap; }
.dia-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dia-nav button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--branco); box-shadow: var(--sombra); font-size: 18px; cursor: pointer; }
.vazio { text-align: center; color: var(--suave); padding: 22px 8px; font-size: 14px; }

/* Gráficos */
.graf { width: 100%; display: block; }
.legenda { display: flex; gap: 14px; font-size: 12px; color: var(--suave); margin-top: 8px; flex-wrap: wrap; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tabs { display: flex; background: var(--areia); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 999px; font-weight: 700; cursor: pointer; font-size: 14px; }
.tabs button.on { background: var(--branco); box-shadow: var(--sombra); }
.delta { font-size: 12px; font-weight: 700; color: var(--suave); }

/* Consultora */
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg { padding: 12px 15px; border-radius: 18px; max-width: 92%; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { background: var(--grafite); color: var(--off); align-self: flex-end; border-bottom-right-radius: 6px; }
.msg.assistant { background: var(--branco); box-shadow: var(--sombra); align-self: flex-start; border-bottom-left-radius: 6px; white-space: normal; }
.msg.assistant p { margin-bottom: 8px; } .msg.assistant p:last-child { margin-bottom: 0; }
.msg.assistant ul, .msg.assistant ol { padding-left: 20px; margin-bottom: 8px; }
.envio { position: sticky; bottom: 84px; display: flex; gap: 8px; background: var(--off); padding-top: 8px; }
.envio textarea { min-height: 50px; max-height: 140px; border-radius: 22px; }
.envio .btn { padding: 0 18px; }
.aviso { background: #F3ECE2; border-radius: 14px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px; }
.digitando { color: var(--suave); font-size: 14px; font-style: italic; }

/* Modal */
.fundo { position: fixed; inset: 0; background: rgba(65, 67, 63, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--off); width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 92vh; overflow-y: auto; animation: sobe .2s ease-out; }
.modal h2 { font-size: 20px; margin-bottom: 4px; }
.modal .acoes-modal { display: flex; gap: 10px; margin-top: 20px; } .modal .acoes-modal .btn { flex: 1; }
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) { .fundo { align-items: center; } .modal { border-radius: 24px; } }

/* Telas de acesso */
.acesso { max-width: 420px; margin: 0 auto; padding: 40px 22px; min-height: 100vh; }
.acesso .logo { justify-content: center; margin-bottom: 8px; font-size: 30px; }
.acesso .sub { text-align: center; color: var(--suave); margin-bottom: 26px; }
.toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); background: var(--grafite); color: var(--off); padding: 11px 20px;
  border-radius: 999px; font-size: 14px; font-weight: 700; z-index: 30; box-shadow: var(--sombra); }

/* Próxima janela de sono */
.janela { background: var(--salvia-cl, #E4EAE2); }
.janela .faixa { font-size: 30px; font-weight: 800; color: var(--salvia-esc, #566953); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.janela .estado { font-weight: 700; margin-bottom: 6px; }
.janela.aberta { background: #D6E2D2; }
.janela.passou { background: var(--terra-cl, #F2E4DD); }
.janela.passou .faixa { color: var(--terra-esc, #8E5440); }
