:root {
  --green: #169c7a;
  --green-d: #0f6e56;
  --ink: #16332d;
  --muted: #6b7f7a;
  --coral: #f26d6d;
  --cream: #fff8f1;
  --card: #ffffff;
  --mint: #e6f6ef;
  --peach: #fff0dc;
  --rose: #fbe9ec;
  --sky: #e8f1fb;
  --lilac: #f1ecfb;
  --line: #ece5dc;
  --warn: #c47a12;
  --danger: #c94a4a;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(22, 51, 45, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: #efe7dc;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

/* Moldura de celular no desktop, tela cheia no mobile */
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--cream);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (min-width: 600px) {
  body { padding: 24px 0; }
  .phone {
    height: min(900px, calc(100dvh - 48px));
    border-radius: 42px;
    border: 10px solid var(--ink);
    box-shadow: 0 20px 60px rgba(22, 51, 45, .25);
  }
}

.screen {
  flex: 1;
  overflow-y: auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px 24px;
}
.screen.no-tabs { padding-bottom: 24px; }

/* Barra inferior */
.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar[hidden] { display: none; }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700;
  padding: 4px 0; border-radius: 12px;
}
.tabbar a .ico { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tabbar a.on { color: var(--green); }
.tabbar a.on .ico { filter: none; opacity: 1; }

/* Tipografia e cabeçalhos */
h1 { font-size: 24px; font-weight: 900; margin: 0; letter-spacing: -.3px; }
h2 { font-size: 17px; font-weight: 800; margin: 22px 0 10px; }
h3 { font-size: 15px; font-weight: 800; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.tag-new {
  display: inline-block; font-size: 10.5px; font-weight: 900; letter-spacing: .5px;
  color: #fff; background: var(--coral); border-radius: 6px; padding: 1px 6px; vertical-align: middle;
}

.topbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.topbar h1 { flex: 1; font-size: 22px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: #fff; box-shadow: var(--shadow); display: grid; place-items: center;
  font-size: 18px; flex: none; text-decoration: none; color: var(--ink);
}
.icon-btn.primary { background: var(--green); color: #fff; font-size: 22px; font-weight: 800; }
.subtitle { color: var(--muted); font-size: 14px; margin: -8px 0 14px; }

/* Cartões */
.card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 10px; }
.card.mint { background: var(--mint); box-shadow: none; }
.card.peach { background: var(--peach); box-shadow: none; }
.card.rose { background: var(--rose); box-shadow: none; }
.card.sky { background: var(--sky); box-shadow: none; }
.card.lilac { background: var(--lilac); box-shadow: none; }
.card.tap { cursor: pointer; transition: transform .12s; }
.card.tap:active { transform: scale(.98); }
.stack > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 800;
  background: var(--green); color: #fff; text-decoration: none; font-size: 15px;
}
.btn.block { width: 100%; }
.btn.ghost { background: var(--mint); color: var(--green-d); }
.btn.light { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.btn.danger { background: var(--rose); color: var(--danger); }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--green); font-weight: 800; padding: 0; font-size: 14px; text-decoration: none; }

/* Avatares */
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 900; font-size: 20px;
  background: var(--peach); overflow: hidden; color: var(--ink);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; font-size: 40px; }
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.avatar.xs { width: 22px; height: 22px; font-size: 10px; }

/* Chips de cachorro */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 2px solid transparent; background: #fff; border-radius: 999px;
  padding: 4px 12px 4px 4px; font-weight: 800; font-size: 14px; box-shadow: var(--shadow);
}
.chip.plain { padding: 7px 14px; }
.chip.on { border-color: var(--green); background: var(--mint); color: var(--green-d); }

/* Barra de progresso */
.bar { height: 8px; background: rgba(22, 51, 45, .08); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 99px; }

/* Status */
.pill { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 99px; padding: 3px 10px; }
.pill.ok { background: var(--mint); color: var(--green-d); }
.pill.wait { background: var(--peach); color: var(--warn); }
.pill.late { background: var(--rose); color: var(--danger); }
.pill.info { background: var(--sky); color: #2c5b8a; }

/* Lista de tarefas */
.task {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border-radius: 16px; padding: 12px; box-shadow: var(--shadow);
}
.task + .task { margin-top: 8px; }
.task .emoji {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 20px; background: var(--mint); flex: none;
}
.task.done .emoji { background: var(--mint); }
.task.pending .emoji { background: var(--peach); }
.check {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line);
  background: #fff; flex: none; display: grid; place-items: center; font-size: 15px; color: #fff;
}
.task.done .check, .check.on { background: var(--green); border-color: var(--green); }
.task.done h3 { color: var(--muted); }

/* Semana */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 4px 0 6px; }
.week .d {
  text-align: center; border-radius: 14px; padding: 6px 0; font-size: 11px; color: var(--muted); font-weight: 700;
}
.week .d b { display: block; font-size: 16px; color: var(--ink); }
.week .d.today { background: var(--green); color: #e8fff7; }
.week .d.today b { color: #fff; }

/* Ações rápidas */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  text-decoration: none; color: var(--ink); font-size: 11.5px; font-weight: 800;
}
.quick a span {
  width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center;
  font-size: 24px; background: #fff; box-shadow: var(--shadow);
}

/* Formulários */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 800; margin-bottom: 5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 13px;
  padding: 11px 13px; font-size: 15px; outline: none;
}
.input:focus { border-color: var(--green); }
textarea.input { resize: vertical; min-height: 70px; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.options label { position: relative; }
.options input { position: absolute; opacity: 0; inset: 0; }
.options label span {
  display: inline-block; padding: 8px 13px; border-radius: 12px; background: #fff;
  border: 1.5px solid var(--line); font-weight: 700; font-size: 14px;
}
.options input:checked + span { border-color: var(--green); background: var(--mint); color: var(--green-d); }
.options input:focus-visible + span { outline: 2px solid var(--green); }

.photo-pick {
  display: grid; place-items: center; margin: 4px auto 16px; position: relative; width: 110px;
}
.photo-pick .cam {
  position: absolute; right: 2px; bottom: 2px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--green); color: #fff; display: grid; place-items: center; border: 3px solid var(--cream);
}

.stepper { display: flex; gap: 6px; margin-bottom: 16px; }
.stepper i { flex: 1; height: 5px; border-radius: 9px; background: var(--line); }
.stepper i.on { background: var(--green); }
.step[hidden] { display: none; }

/* Bottom sheet */
.sheet-backdrop {
  position: absolute; inset: 0; background: rgba(22, 51, 45, .35); z-index: 20;
  display: flex; align-items: flex-end; animation: fade .15s;
}
.sheet {
  width: 100%; max-height: 88%; overflow-y: auto; background: var(--cream);
  border-radius: 26px 26px 0 0; padding: 10px 18px 22px; animation: up .2s ease-out;
}
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin-top: 0; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: absolute; left: 50%; bottom: 90px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 14px;
  font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 40;
  max-width: 85%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Splash */
.splash { text-align: center; padding-top: 30px; }
.brand { font-weight: 900; font-size: 44px; line-height: 1; letter-spacing: -1px; color: var(--green); }
.brand em { font-style: normal; color: var(--coral); display: block; }
.splash .paw { font-size: 64px; }
.splash .hero {
  margin: 24px auto; width: 210px; height: 210px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #ffe9d2, #ffd9e0); display: grid; place-items: center; font-size: 110px;
}

/* Planner */
.plan-day { background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow); }
.plan-day + .plan-day { margin-top: 8px; }
.plan-day.today { outline: 2px solid var(--green); }
.plan-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.slot { background: var(--cream); border-radius: 12px; padding: 6px; min-height: 54px; }
.slot .lbl { font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.slot .item {
  display: block; width: 100%; text-align: left; border: 0; margin-top: 4px; font-size: 12px; font-weight: 800;
  background: var(--mint); color: var(--green-d); border-radius: 8px; padding: 4px 6px; line-height: 1.2;
}
.slot .item small { display: block; font-weight: 600; color: var(--muted); font-size: 10.5px; }
.slot .add { border: 1.5px dashed var(--line); background: none; width: 100%; border-radius: 8px; margin-top: 4px; color: var(--muted); font-weight: 800; padding: 2px; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.bubble { max-width: 85%; padding: 10px 13px; border-radius: 18px; font-size: 14.5px; line-height: 1.4; white-space: pre-line; }
.bubble.me { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 6px; }
.bubble.bot { align-self: flex-start; background: #fff; box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.bubble.bot b { color: var(--green-d); }
.composer { display: flex; gap: 8px; position: sticky; bottom: -24px; background: var(--cream); padding: 8px 0 4px; }
.composer .input { border-radius: 99px; }
.prompts { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.prompts button { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 11px; font-size: 13px; font-weight: 700; }

/* Medalhas e galeria */
.medal { text-align: center; padding: 12px 6px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.medal .m { font-size: 30px; }
.medal.off { opacity: .4; filter: grayscale(1); }
.medal p { font-size: 11.5px; font-weight: 800; margin-top: 4px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery figure { margin: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; position: relative; background: var(--peach); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; font-weight: 700; color: #fff; padding: 12px 6px 4px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }

.hbar { display: grid; grid-template-columns: 90px 1fr 28px; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.hbar + .hbar { margin-top: 8px; }

.mood { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mood label { position: relative; }
.mood input { position: absolute; opacity: 0; inset: 0; }
.mood span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); font-size: 10.5px; font-weight: 800; text-align: center; }
.mood span i { font-style: normal; font-size: 24px; }
.mood input:checked + span { border-color: var(--green); background: var(--mint); }

.menu a {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; text-decoration: none; color: var(--ink);
  background: #fff; border-radius: 16px; box-shadow: var(--shadow); font-weight: 800;
}
.menu a + a { margin-top: 8px; }
.menu a .e { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--mint); font-size: 19px; }
.menu a .chev { margin-left: auto; color: var(--muted); }

.empty { text-align: center; padding: 22px 10px; color: var(--muted); font-size: 14px; }
.empty .e { font-size: 36px; display: block; margin-bottom: 6px; }

.notice { font-size: 12.5px; color: var(--muted); background: #fff; border-left: 4px solid var(--coral); border-radius: 10px; padding: 10px 12px; margin-top: 12px; }

/* Pop-ups de lembrete e avisos da família */
.popup-root {
  position: absolute; left: 10px; right: 10px; top: calc(10px + env(safe-area-inset-top));
  z-index: 50; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.popup {
  pointer-events: auto; background: #fff; border-radius: 18px; padding: 12px 12px 12px 14px;
  box-shadow: 0 10px 30px rgba(22, 51, 45, .22); border-left: 5px solid var(--green);
  animation: drop .25s ease-out;
}
.popup b { font-size: 15px; }
.popup-x { border: 0; background: var(--cream); width: 28px; height: 28px; border-radius: 50%; font-size: 13px; color: var(--muted); flex: none; }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }

/* Crescimento: foto grande, antes e depois, medidas */
.growth-photo { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 14px; margin-bottom: 10px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; }
.compare figure { margin: 0; position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--peach); cursor: pointer; }
.compare img { width: 100%; height: 100%; object-fit: cover; }
.compare figcaption { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; color: #fff; padding: 16px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
details.field summary { cursor: pointer; font-weight: 800; font-size: 14px; }
details.field small { display: block; margin-top: 3px; line-height: 1.25; }

/* Horários das refeições na despensa */
.meal-times { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meal-slot { display: inline-flex; align-items: center; gap: 2px; }
.meal-slot[hidden] { display: none; }
.meal-slot .input { width: 104px; padding: 8px 10px; }
.meal-slot .icon-btn { width: 30px; height: 30px; font-size: 13px; }
