/* Kevin's Kitchen styles.
   1. Tokens: every color, size, space and corner comes from here; components never invent their own.
   2. Base   3. Shared components (cards, pills, icon buttons, sheets)   4. Screens, top to bottom. */

/* ---------- 1. tokens ---------- */
:root {
  color-scheme: light;
  /* color: light */
  --bg: #f6f3ee; --surface: #ffffff; --ink: #2a1d14; --muted: #7a6a5d; --line: #e4ddd3; --done: #b8ada3;
  --toffee: #a5561b; --toffee-soft: #f3e3d3;   /* amounts, stats, the current item */
  --ok: #2f7d4f; --ok-soft: #dcefe3;           /* done, on, equipment */
  --link: #2f6aa0; --link-soft: #dde9f5;       /* links and jumps */
  --alarm: #c2341f;                            /* warnings, timers going off */
  --g-s: #8a4fd0; --g-a: #2f8f52; --g-b: #5f9a2a; --g-c: #a8860a; --g-d: #c4621a; --g-f: #c2341f; /* grades */
  --scrim: rgba(0, 0, 0, .45);
  /* type */
  --font-display: "Young Serif", Georgia, serif;
  --font-body: "Atkinson Hyperlegible", -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace; /* timer digits only */
  --t-xs: 13px; --t-s: 15px; --t-m: 17px; --t-body: 19px; --t-l: 20px; --t-xl: 24px; --t-xxl: 34px;
  /* space, corners, sizes */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-pill: 999px;
  --tap: 44px;         /* smallest thing a finger has to hit */
  --icon-btn: 36px;    /* round buttons beside an item */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .08);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, .18);
  --gutter: max(var(--s4), env(safe-area-inset-left, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17120e; --surface: #221a14; --ink: #f2e9df; --muted: #a8998b; --line: #3a2e25; --done: #6a5d52;
    --toffee: #e39a5c; --toffee-soft: #3b2718; --ok: #6fcf97; --ok-soft: #1d3326; --link: #7fb6e8; --link-soft: #1b2a38;
    --alarm: #ff7a63;
    --g-s: #c08cff; --g-a: #5fd38a; --g-b: #a6d65a; --g-c: #f0cc3c; --g-d: #f59a52; --g-f: #ff6b5e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17120e; --surface: #221a14; --ink: #f2e9df; --muted: #a8998b; --line: #3a2e25; --done: #6a5d52;
  --toffee: #e39a5c; --toffee-soft: #3b2718; --ok: #6fcf97; --ok-soft: #1d3326; --link: #7fb6e8; --link-soft: #1b2a38;
  --alarm: #ff7a63;
  --g-s: #c08cff; --g-a: #5fd38a; --g-b: #a6d65a; --g-c: #f0cc3c; --g-d: #f59a52; --g-f: #ff6b5e;
}

/* ---------- 2. base ---------- */
* { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--t-body); line-height: 1.5; font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
img { max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, label:focus-within { outline: 3px solid var(--toffee); outline-offset: 2px; }
.wrap { max-width: 680px; margin: 0 auto; padding-inline: var(--gutter); }
main { padding-block: var(--s3) 140px; }
h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--t-xl); margin: var(--s5) 0 var(--s2);
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
h2:first-child { margin-top: var(--s1); }
h2 small { font-family: var(--font-body); font-size: var(--t-s); color: var(--muted); }
h3 { font-size: var(--t-m); margin: var(--s4) 0 var(--s1); color: var(--muted); }
.lead { margin: var(--s1) 0 0; color: var(--muted); font-size: var(--t-m); }
@keyframes blink { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- 3. shared components ---------- */
/* cards: anything that's a box on the page */
.card, .step, .note, .scale, .feed-card, .timer, .xlink, .peek {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
}
/* pills: chips, sub-tabs, picks */
.chip, .subtabs button, .picks button, .fact {
  display: inline-flex; align-items: center; gap: var(--s1); border-radius: var(--r-pill); white-space: nowrap;
}
.chip { height: var(--icon-btn); border: 2px solid var(--toffee); color: var(--toffee); background: transparent; padding: 0 var(--s3); font-weight: 700; font-size: var(--t-m); }
.chip .mono { font-family: var(--font-mono); }
/* round icon buttons */
.tool, .help, .hear, .sheet-x {
  flex: none; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); padding: 0;
}
.tool svg { width: 20px; height: 20px; }
/* bottom sheets */
.sheet { position: fixed; inset: 0; z-index: 20; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { position: relative; width: 100%; max-width: 680px; max-height: 85vh; overflow-y: auto; background: var(--bg);
  border-radius: 20px 20px 0 0; padding: var(--s5) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom, 0px)); text-align: left; }
.sheet-card > h2:first-of-type { margin-top: 0; padding-right: calc(var(--tap) + var(--s2)); }
.sheet-x { position: absolute; top: var(--s3); right: var(--s3); width: 40px; height: 40px; border: 0; background: var(--line); font-size: 18px; }
/* sheet layout: title, subtitle under it, a summary card, small-caps section headings, rows */
.sheet-card h2 { display: block; }
.sheet-card h2 small { display: block; margin-top: 2px; font-size: var(--t-s); }
.sheet-card h3 { margin: var(--s4) 0 var(--s1); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.summary { display: flex; gap: var(--s3); margin: var(--s3) 0; padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.summary div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.summary div + div { border-left: 1px solid var(--line); padding-left: var(--s3); }
.summary b { font-size: var(--t-xl); color: var(--toffee); line-height: 1.2; }
.summary span { font-size: var(--t-xs); color: var(--muted); }
.money { color: var(--toffee); font-weight: 700; }
/* tables in sheets (calories, cost) */
table.kcal { width: 100%; border-collapse: collapse; font-size: var(--t-m); }
table.kcal td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kcal td:last-child { text-align: right; font-weight: 700; color: var(--toffee); padding-left: var(--s3); }
table.kcal small { display: block; color: var(--muted); font-size: var(--t-xs); }
table.kcal tr.opt { color: var(--muted); }
/* the toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 8;
  max-width: calc(100% - 2 * var(--s4)); padding: 10px var(--s4); border-radius: var(--r-m); background: var(--ink); color: var(--bg); font-size: var(--t-s); }

/* ---------- 4. screens ---------- */
/* header: a toolbar (Hamagotchi left, icons right), the line above the title, the title, the metrics strip */
header.hero { padding-block: var(--s3) var(--s4); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.tools { display: flex; gap: var(--s2); }
.tool { width: 40px; height: 40px; color: var(--muted); }
.tool[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.tool.rec svg { width: 16px; height: 16px; }
.tool.rec[aria-pressed="true"] { border-color: var(--alarm); background: transparent; color: var(--alarm); animation: blink 1.6s ease-in-out infinite; }
.eyebrow { font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--t-xxl); line-height: 1.1; margin: var(--s1) 0 var(--s4); text-wrap: balance; }
/* five tiles in a row: icon, value, label */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: var(--s2) var(--s1);
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); text-align: center; }
.stat-icon { font-style: normal; font-size: var(--t-m); line-height: 1; height: var(--t-m); }
.stat-value { font-size: var(--t-m); line-height: 1.15; color: var(--ink); overflow-wrap: anywhere; }
.stat-label { font-size: 11px; color: var(--muted); line-height: 1.2; }
.stat [data-grade] { color: var(--grade); }
.stat .rate { color: var(--link); font-size: var(--t-s); }
.stat .dollar { color: var(--ok); font-weight: 800; }
@media (max-width: 360px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* sticky tab bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding-block: var(--s2) 10px; border-bottom: 1px solid var(--line); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); padding: var(--s1); border-radius: var(--r-m); background: var(--line); }
.tabs button { border: 0; background: transparent; padding: 9px 2px; border-radius: 9px; font-weight: 700; font-size: var(--t-s); color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.count { font-size: var(--t-xs); font-weight: 400; margin-left: var(--s1); opacity: .8; }
/* sub-tabs: pinned under the bar, scroll sideways */
.subtabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--bar-h, 0px)); z-index: 4; background: var(--bg);
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 6px; padding-block: var(--s2); }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: none; border: 2px solid var(--line); background: transparent; padding: 6px var(--s3); font-weight: 700; font-size: var(--t-s); color: var(--muted); }
.subtabs button[aria-selected="true"] { background: var(--toffee); border-color: var(--toffee); color: var(--surface); }

/* ingredients: sub-tabs + portions pinned; checklist rows */
.ing-top { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--bar-h, 0px)); z-index: 4; background: var(--bg); padding-block: var(--s2); }
.ing-top .subtabs { position: static; padding: 0; margin: 0 0 var(--s2); }
.scale { padding: var(--s2) var(--s3); display: flex; flex-direction: column; gap: 10px; }
.scale-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.scale-label { display: flex; flex-direction: column; min-width: 0; }
.scale-label strong { font-size: 18px; }
.scale-label span { font-size: var(--t-s); color: var(--toffee); font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 40px; height: 40px; border-radius: var(--r-m); border: 2px solid var(--toffee); background: transparent; color: var(--toffee);
  font-size: 26px; font-weight: 700; line-height: 1; display: grid; place-items: center; }
.stepper button:disabled { opacity: .35; }
.stepper input { width: 64px; padding: var(--s1) 0; border: 2px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink);
  text-align: center; font-weight: 700; font-size: var(--t-xl); -moz-appearance: textfield; appearance: textfield; }
.stepper input:focus { outline: none; border-color: var(--toffee); }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
#view-ing > .hint { font-size: var(--t-s); color: var(--muted); margin: var(--s1) 0 0; }
.ings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ing { display: flex; gap: var(--s3); align-items: flex-start; padding: 10px var(--s1); border-bottom: 1px solid var(--line); cursor: pointer; }
.ing input { position: absolute; opacity: 0; pointer-events: none; }
.box { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 7px; border: 2px solid var(--muted); display: grid; place-items: center; }
.box svg { width: 16px; height: 16px; opacity: 0; }
.ing .qty { font-weight: 700; color: var(--toffee); white-space: nowrap; }
.ing .what { min-width: 0; }
.ing .opt { font-size: var(--t-s); color: var(--muted); }
/* grocery list: rows under aisle headings; price on the right */
h3.aisle { margin: var(--s4) 0 0; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--ok); }
.ing.grocery .what { flex: 1; display: flex; flex-direction: column; }
.ing.grocery .what small { font-size: var(--t-s); color: var(--muted); }
.ing.grocery .what em { font-style: normal; font-weight: 700; font-size: var(--t-s); color: var(--alarm); }
.ing .price { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.ing .price b { color: var(--toffee); }
.ing .price small { font-size: var(--t-xs); color: var(--muted); }
.ing.is-done .price b, .ing.grocery.is-done .what b { color: var(--done); text-decoration: line-through; }
.ing.is-done .box { background: var(--ok); border-color: var(--ok); }
.ing.is-done .box svg { opacity: 1; }
.ing.is-done .what, .ing.is-done .qty { color: var(--done); text-decoration: line-through; }

/* prep and steps: one card per item. Number | text; under the text one row: timer left, round buttons right;
   panels open under that. The current item gets the toffee outline; done items fade and cross out. */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.step { padding: var(--s3) var(--s3) var(--s3) 10px; display: grid; grid-template-columns: var(--icon-btn) minmax(0, 1fr); gap: 0 var(--s3); }
.step.is-current { border-color: var(--toffee); box-shadow: 0 0 0 1px var(--toffee) inset; background: linear-gradient(var(--toffee-soft), var(--toffee-soft)) 0 0 / 4px 100% no-repeat, var(--surface); }
.step.is-done { opacity: .55; }
.step.flash { animation: flash 1.6s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 4px var(--link); } }
.step .num { width: var(--icon-btn); height: var(--icon-btn); border-radius: 50%; border: 0; display: grid; place-items: center;
  font-weight: 700; font-size: var(--t-m); background: var(--toffee-soft); color: var(--toffee); }
.step.is-current .num { background: var(--toffee); color: var(--surface); }
.step.is-done .num { background: var(--ok); color: #fff; }
.step .body { min-width: 0; font-size: var(--t-body); line-height: 1.5; padding-top: 4px; }
.step.is-done .body { text-decoration: line-through; text-decoration-color: var(--done); }
.step .body .ref { font-weight: 700; }
.step .body .amt { color: var(--toffee); font-weight: 700; white-space: nowrap; }
.step .ptitle { display: block; font-size: var(--t-m); color: var(--muted); font-weight: 700; }
.step .tools { grid-column: 2; display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.step .aside { display: flex; gap: 6px; margin-left: auto; }
.help { width: var(--icon-btn); height: var(--icon-btn); border-color: var(--toffee); background: transparent; color: var(--toffee); font-weight: 700; font-size: var(--t-m); }
.help[aria-expanded="true"] { background: var(--toffee); color: var(--surface); }
.help.why { border-color: var(--muted); color: var(--muted); }
.help.why[aria-expanded="true"] { background: var(--muted); color: var(--surface); }
.help.remind { border-color: var(--alarm); color: var(--alarm); font-size: var(--t-body); }
.help.remind[aria-expanded="true"] { background: var(--alarm); color: var(--surface); }
.help.link { border-color: var(--link); color: var(--link); }
.help.link[aria-expanded="true"] { background: var(--link); color: var(--surface); }
.help svg { width: 18px; height: 18px; }
.step .tip { grid-column: 2; margin-top: var(--s2); padding: 10px var(--s3); border-radius: 10px; background: var(--toffee-soft); font-size: var(--t-m); line-height: 1.45; }
.step .tip + .tip { margin-top: 6px; }
.step .tip strong { display: block; margin-bottom: 2px; }
.step .tip ol { margin: var(--s1) 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.step .tip li img { display: block; width: 100%; max-width: 240px; margin: 6px 0 2px; border-radius: var(--r-s); }
.step .tip.whytip { background: transparent; border: 1px dashed var(--muted); }
.step .tip.remindtip { background: transparent; border: 2px solid var(--alarm); }
.step .tip.linktip { background: var(--link-soft); }
.xlink { display: block; width: 100%; text-align: left; margin-top: 6px; padding: var(--s2) 10px; border-radius: 10px; font-size: var(--t-m); line-height: 1.4; }
.xlink b { display: block; color: var(--link); font-size: var(--t-s); }
.mark { display: inline-block; font-size: var(--t-s); font-weight: 700; padding: 1px var(--s2); border-radius: var(--r-pill); white-space: nowrap; vertical-align: 2px; }
.mark.pause { margin-left: 6px; background: var(--line); color: var(--muted); }
.mark.switch { display: table; margin-bottom: var(--s1); background: var(--toffee-soft); color: var(--toffee); }
/* in recipe text */
.iref { cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; font-weight: 700; color: var(--link);
  text-decoration: underline dotted; text-underline-offset: 3px; }
[data-go] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.equip { color: var(--ok); }
.warn { color: var(--alarm); }
/* press-and-hold preview */
.peek { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  width: min(520px, calc(100% - 2 * var(--s4))); padding: 14px var(--s4); border: 2px solid var(--link); box-shadow: var(--shadow-2); font-size: var(--t-m); line-height: 1.45; }
.peek small { display: block; color: var(--muted); font-size: var(--t-xs); }
.peek strong { display: block; }

/* notes */
.notes { display: flex; flex-direction: column; gap: var(--s3); }
.note { padding: 14px var(--s4); }
.note strong { display: block; margin-bottom: 2px; }
.src { font-size: var(--t-s); color: var(--muted); }
.src a { color: var(--toffee); }
.reset { margin-top: var(--s5); border: 1px solid var(--line); background: transparent; border-radius: 10px; padding: 10px 14px; font-size: var(--t-m); color: var(--muted); }

/* timers: dock at the bottom */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg); border-top: 1px solid var(--line); }
.dock .wrap { display: flex; gap: var(--s2); overflow-x: auto; }
.timer { flex: none; min-width: min(330px, calc(100vw - 2 * var(--s4))); display: flex; align-items: stretch; gap: 10px; padding: 10px 10px 10px 14px; border: 2px solid var(--toffee); }
.timer .tmain { flex: 1; min-width: 0; }
.timer .l { font-size: var(--t-s); color: var(--muted); line-height: 1.2; }
.timer .l b { color: var(--ink); }
.timer .tstatus { font-weight: 700; color: var(--alarm); font-size: var(--t-m); }
.timer .t { font-family: var(--font-mono); font-weight: 700; font-size: 26px; }
.timer .t small { font-family: var(--font-body); font-size: var(--t-xs); font-weight: 400; color: var(--muted); margin-left: var(--s2); }
.tbar { position: relative; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--line); }
.tbar span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--toffee); }
.tbar i { position: absolute; top: -3px; width: 2px; height: var(--s3); background: var(--ink); }
.timer .tbtns { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.timer .tbtns button { min-width: var(--tap); height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--toffee-soft); font-weight: 700; }
.timer .tbtns button.ok { background: var(--ok); color: var(--surface); }
.timer.checking { border-color: var(--ok); }
.timer.checking .t, .timer.checking .tstatus { color: var(--ok); }
.timer.ringing { border-color: var(--alarm); animation: pulse 1s infinite; }
.timer.ringing .t { color: var(--alarm); }
@keyframes pulse { 50% { background: var(--toffee-soft); } }

/* sheets: rows, sessions, ratings */
ul.sessions, .meals { list-style: none; margin: 0; padding: 0; }
ul.sessions li { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.sessions li div { flex: 1; display: flex; flex-direction: column; }
ul.sessions li span { color: var(--muted); font-size: var(--t-s); }
ul.sessions .del { border: 1px solid var(--line); background: none; border-radius: var(--r-pill); min-width: 36px; height: 36px; color: var(--muted); }
ul.sessions .del.sure { background: var(--alarm); border-color: var(--alarm); color: #fff; padding: 0 var(--s3); }
.picks { display: flex; flex-wrap: wrap; gap: var(--s2); }
.picks button { min-width: 52px; justify-content: center; padding: var(--s2) 14px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; }
.picks button[aria-pressed="true"] { background: var(--toffee); border-color: var(--toffee); color: var(--surface); }
.picks button[data-grade] { border-color: var(--grade); color: var(--grade); }
.picks button[data-grade][aria-pressed="true"] { background: var(--grade); color: var(--bg); }
[data-grade^="S"] { --grade: var(--g-s); } [data-grade^="A"], [data-grade="Easy"] { --grade: var(--g-a); }
[data-grade^="B"], [data-grade="Easy–Medium"] { --grade: var(--g-b); } [data-grade^="C"], [data-grade="Medium"] { --grade: var(--g-c); }
[data-grade^="D"], [data-grade="Medium–Hard"] { --grade: var(--g-d); } [data-grade^="F"], [data-grade="Hard"] { --grade: var(--g-f); }

/* Hamagotchi: sits at the left of the toolbar, art beside its fullness meter */
.pet-mini { flex: none; display: flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; height: 40px; border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
.pet-art { display: inline-block; line-height: 0; animation: bob 1.2s steps(2) infinite; }
.pet-art.pet-hungry { animation-duration: 2.4s; }
.pet-art.pet-egg { animation: wobble 2s steps(2) infinite; }
.pet-art.big { display: block; width: fit-content; margin: var(--s2) auto; }
@keyframes bob { 50% { transform: translateY(-2px); } }
@keyframes wobble { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.meter { display: block; width: 44px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ok); }
.sheet-card .meter { width: 160px; height: 10px; margin: 0 auto var(--s2); border-radius: 5px; }
.pet-name { display: block; margin: 0 auto; width: 70%; text-align: center; font-family: var(--font-display); font-size: 28px; border: 0; border-bottom: 2px dashed var(--line); background: transparent; color: var(--ink); }
.pet-status { margin: var(--s2) 0; color: var(--muted); text-align: center; }
.meals li { display: flex; justify-content: space-between; gap: var(--s3); padding: 10px var(--s1); border-bottom: 1px solid var(--line); }
.meals small { color: var(--muted); }
.feed-card { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: 14px; padding: 14px var(--s4); border: 2px dashed var(--toffee); }
.feed-card.done { border-style: solid; border-color: var(--ok); }
.feed-card p { margin: 0; flex: 1; min-width: 0; font-weight: 700; }
.feed-card .food { font-size: 34px; line-height: 1; }
.feed-card .food-img { width: 1.3em; height: 1.3em; }
.feed-card.eating .food { animation: eat 2.4s steps(4) forwards; }
@keyframes eat { to { transform: scale(0); opacity: 0; } }
.feed-card .done-btn { margin-left: auto; padding: 10px 26px; font-size: 18px; background: var(--toffee); color: var(--surface); }
.food-img { width: 1em; height: 1em; image-rendering: pixelated; vertical-align: -0.12em; }

/* the grocery list's store, and the store sheet */
.store-pick { display: block; margin: var(--s2) 0; border: 0; background: none; padding: 0; text-align: left; font-size: var(--t-s); color: var(--muted); }
button.store-pick { color: var(--link); }
.zip { display: flex; gap: var(--s2); }
.zip input { flex: 1; min-width: 0; }
ul.stores { list-style: none; margin: var(--s3) 0 0; padding: 0; }
ul.stores button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: var(--s3) 0; font-size: var(--t-m); color: var(--ink); }

/* segmented control (a row of tabs in a pill) */
.seg { display: flex; gap: var(--s1); padding: var(--s1); border-radius: var(--r-m); background: var(--line); margin: 0 0 var(--s3); }
.seg button { flex: 1; border: 0; background: transparent; padding: var(--s2); border-radius: var(--r-s); font-weight: 700; font-size: var(--t-s); color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.sheet-card h4 { margin: var(--s3) 0 var(--s1); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- recipe book (index.html) ---------- */
.toolbar-left { display: flex; align-items: center; gap: var(--s2); }
.back { color: var(--link); font-weight: 700; text-decoration: none; font-size: var(--t-s); white-space: nowrap; }
.book-hero h1 { margin-bottom: var(--s3); }
.search input { width: 100%; height: var(--tap); padding: 0 var(--s4); border: 2px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-m); }
.search input:focus { outline: none; border-color: var(--toffee); }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: var(--s3); padding-bottom: 2px; }
.filters::-webkit-scrollbar { display: none; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: transparent; border-radius: var(--r-pill); padding: 6px var(--s3); font-weight: 700; font-size: var(--t-s); color: var(--muted); white-space: nowrap; }
.pill[aria-pressed="true"] { background: var(--toffee); border-color: var(--toffee); color: var(--surface); }
.pill.clear { border-color: transparent; color: var(--link); }
.cards { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.recipe-card { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s4); color: inherit; text-decoration: none; }
.rc-title { font-family: var(--font-display); font-size: var(--t-xl); line-height: 1.15; }
.minis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s1); margin-top: var(--s2); }
.mini { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; padding: 6px 2px; border-radius: var(--r-s); background: var(--bg); }
.mini i { font-style: normal; font-size: var(--t-s); line-height: 1; }
.mini b { font-size: var(--t-s); line-height: 1.2; overflow-wrap: anywhere; }
.mini small { font-size: 10px; color: var(--muted); }
.mini [data-grade] { color: var(--grade); }
.mini .dollar, .ranges .dollar { color: var(--ok); font-weight: 800; }
.uses { font-size: var(--t-s); color: var(--ok); font-weight: 700; margin-top: var(--s1); }
.empty { color: var(--muted); padding: var(--s5) 0; text-align: center; }
.ranges { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: center; margin: var(--s3) 0; }
.ranges label { font-weight: 700; }
.ranges label small { font-weight: 400; color: var(--muted); }
.ranges div { display: flex; align-items: center; gap: var(--s2); }
.ranges input, .ranges select, .zip input { width: 100%; min-width: 0; height: 40px; padding: 0 var(--s2); border: 2px solid var(--line); border-radius: var(--r-m);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-m); }
.ing-index { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: var(--s4); }
.ing-index button { width: 100%; display: flex; justify-content: space-between; gap: var(--s2); border: 0; border-bottom: 1px solid var(--line);
  background: none; padding: var(--s2) 0; text-align: left; text-transform: capitalize; }
.ing-index small { color: var(--muted); }
