:root {
  --bg: #fdf7f0;
  --bg2: #f6e9dc;
  --card: #fffdfb;
  --ink: #3a2b21;
  --dim: #8a7565;
  --line: #eddfd0;
  --brand: #8a5a3b;
  --old: #e8825e;          /* salmon */
  --new: #d9a441;          /* chicken & rice */
  --shadow: 0 2px 4px rgba(90, 60, 35, .05), 0 8px 24px rgba(90, 60, 35, .07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1512; --bg2: #241c16; --card: #251e19; --ink: #f5ece3;
    --dim: #ab9583; --line: #3a2f27; --brand: #e0aa78;
    --old: #f09a75; --new: #e8bb63;
    --shadow: 0 2px 4px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); padding-bottom: 2rem;
  background: radial-gradient(1100px 460px at 50% -180px, var(--bg2), var(--bg) 70%) var(--bg);
  /* rounded system face where it exists (iOS/macOS), graceful elsewhere */
  font: 16px/1.45 ui-rounded, "SF Pro Rounded", "Nunito", system-ui,
        -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */
header {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 1rem 1.1rem 0.8rem; max-width: 560px; margin: 0 auto;
}
.pupicon { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 2px 3px rgba(90,60,35,.18)); }
.htext { flex: 1; }
h1 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; color: var(--brand); }
.today { font-size: 0.8rem; color: var(--dim); margin-top: 1px; }

main { max-width: 560px; margin: 0 auto; padding: 0 1rem; }

/* ---------- hero card ---------- */
.hero {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 1.1rem 1rem 1.2rem; text-align: center; box-shadow: var(--shadow);
  animation: rise .45s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .hero { animation: none; } }

.daystrip { display: flex; gap: 0.45rem; justify-content: center; flex-wrap: wrap; }
.badge {
  background: linear-gradient(135deg, var(--brand), #a8703f); color: #fff;
  border-radius: 999px; padding: 0.32rem 0.85rem; font-size: 0.85rem; font-weight: 700;
  box-shadow: 0 2px 6px rgba(138, 90, 59, .28);
}
@media (prefers-color-scheme: dark) { .badge { color: #1a1512; } }
.badge.ghost {
  background: transparent; color: var(--dim); border: 1.5px solid var(--line);
  font-weight: 600; box-shadow: none;
}

/* stage progress dots */
.dots { display: flex; gap: 6px; justify-content: center; margin: 0.8rem 0 0.2rem; }
.dot { width: 7px; height: 7px; border-radius: 999px; background: var(--line); transition: all .3s; }
.dot.done { background: var(--old); }
.dot.on { width: 22px; background: linear-gradient(90deg, var(--old), var(--new)); }

.perlabel { color: var(--dim); font-size: 0.88rem; margin: 0.7rem 0 0.6rem; }

/* ---------- the two bowls ---------- */
.bowls { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.bowl {
  border: 1.5px solid var(--line); border-radius: 16px; padding: 0.75rem 0.4rem 0.85rem;
  background: linear-gradient(180deg, var(--sheen), transparent);
}
:root { --sheen: rgba(255, 255, 255, .5); }
@media (prefers-color-scheme: dark) { :root { --sheen: rgba(255, 255, 255, .035); } }
.bowlart { width: 40px; height: 31px; display: block; margin: 0 auto 0.15rem; }
/* colour the <use> host: currentColor + custom props inherit into its shadow
   tree, ordinary descendant selectors do not */
.bowl.old .bowlart {
  color: var(--old);
  --rim: color-mix(in srgb, var(--old) 62%, #fff);
  --kib: color-mix(in srgb, var(--old) 60%, #6b4a2f);
}
.bowl.new .bowlart {
  color: var(--new);
  --rim: color-mix(in srgb, var(--new) 62%, #fff);
  --kib: color-mix(in srgb, var(--new) 60%, #6b4a2f);
}
.foodname {
  font-size: 0.68rem; color: var(--dim); line-height: 1.25; min-height: 2.5em;
  display: flex; flex-direction: column;
}
.foodname span { opacity: 0.8; }
.amount {
  font-weight: 800; margin-top: 0.4rem; letter-spacing: -0.03em; color: var(--ink);
  white-space: nowrap; font-size: clamp(0.98rem, 5vw, 1.4rem);
}

/* ---------- mix meter ---------- */
.mixwrap { margin: 0.95rem 0 0.2rem; }
.mix {
  display: flex; height: 9px; border-radius: 999px; overflow: hidden;
  background: var(--line);
}
.seg { transition: width .4s cubic-bezier(.2,.8,.3,1); }
.seg.o { background: var(--old); }
.seg.n { background: var(--new); }
.mixlabels {
  display: flex; justify-content: space-between; font-size: 0.7rem;
  color: var(--dim); margin-top: 0.3rem;
}

.daily { margin-top: 0.8rem; font-size: 0.93rem; }
.next { margin-top: 0.45rem; font-size: 0.85rem; color: var(--dim); line-height: 1.5; }
.next.done { color: var(--brand); font-weight: 700; }
.fine { font-size: 0.76rem; color: var(--dim); }

/* ---------- nudge ---------- */
.adjust { margin-top: 1.1rem; }
.adjlabel { font-size: 0.8rem; color: var(--dim); margin: 0 0 0.5rem; text-align: center; }
.adjrow { display: flex; align-items: center; gap: 0.5rem; }
.btn {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 12px; padding: 0.55rem 0.7rem; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; box-shadow: 0 1px 2px rgba(90,60,35,.05);
}
.btn:active { transform: translateY(1px); }
.offnote { font-size: 0.8rem; color: var(--dim); text-align: center; flex: 1; }
.offnote.shifted { color: var(--old); font-weight: 700; }
.linkbtn {
  background: none; border: none; color: var(--dim); font-size: 0.78rem;
  text-decoration: underline; cursor: pointer; display: block; margin: 0.45rem auto 0;
}
.linkbtn[hidden] { display: none; }   /* display:block would beat [hidden] */

/* ---------- schedule ---------- */
.sched { margin-top: 1.2rem; }
.sched summary {
  cursor: pointer; font-size: 0.92rem; color: var(--brand); font-weight: 700;
  display: flex; align-items: center; gap: 0.4rem; list-style: none;
}
.sched summary::-webkit-details-marker { display: none; }
.pawmark { width: 15px; height: 15px; fill: var(--brand); opacity: .55; flex: none; }
table { width: 100%; border-collapse: collapse; margin-top: 0.65rem; font-size: 0.82rem; }
th, td { text-align: left; padding: 0.45rem 0.3rem; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; }
tr.now { background: color-mix(in srgb, var(--old) 12%, transparent); font-weight: 700; }
tr.now td:first-child { border-radius: 8px 0 0 8px; }
tr.now td:last-child { border-radius: 0 8px 8px 0; }

/* ---------- notes ---------- */
.notes { margin-top: 1.3rem; font-size: 0.85rem; }
.notes p { margin: 0.55rem 0; }
.rule { display: flex; gap: 0.4rem; align-items: flex-start; }
.sig { text-align: center; color: var(--dim); font-size: 0.75rem; margin-top: 1.6rem; }
.heart { color: var(--old); }
