:root {
  --bg: #f5f5f3;
  --card: #ffffff;
  --ink: #1c1c1c;
  --muted: #777;
  --green: #2f7d4f;
  --green-soft: #e7f1ea;
  --line: #e2e2dd;
  --danger: #b23b3b;
  --amber: #b07d00;
  --amber-soft: #fdf3d8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  padding-bottom: 64px;            /* room for the bottom tab bar */
}

header {
  background: var(--green);
  color: #fff;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 { margin: 0; font-size: 20px; }
.header-btn {
  width: auto;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .4);
  padding: 6px 12px;
  font-size: 14px;
}

main { max-width: 820px; margin: 0 auto; padding: 16px; }
.view[hidden] { display: none; }

/* --- form fields (shared by add + edit) --- */
form { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
form .row { display: flex; gap: 8px; }
form .row > * { flex: 1; min-width: 0; }

input, select, button {
  font: inherit;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  width: 100%;
  margin-bottom: 8px;
}

button {
  background: var(--green);
  color: #fff;
  border: none;
  font-weight: 600;
  margin-bottom: 0;
  cursor: pointer;
}
button:active { opacity: .85; }

.hint { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.barcode-row .btn-inline { flex: 0 0 auto; width: auto; padding: 12px 14px; }
#scan-video { width: 100%; border-radius: 8px; background: #000; margin-bottom: 8px; }
.qr-img { display: block; width: 220px; max-width: 70%; height: auto; margin: 8px auto; background: #fff; padding: 10px; border-radius: 8px; }
.qr-url { text-align: center; font-family: ui-monospace, monospace; word-break: break-all; margin: 0 0 8px; }
.bookmarklet-box { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; text-align: center; }
.bookmarklet {
  display: inline-block; margin-top: 6px; padding: 8px 14px;
  background: var(--green); color: #fff; border-radius: 8px;
  text-decoration: none; font-weight: 600; cursor: grab;
}
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* --- floating toast (feedback + undo) --- */
.toast {
  position: fixed;
  left: 50%; bottom: 72px;                 /* clears the tab bar */
  transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 10px;
  font-size: 14px; max-width: 90vw;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 20;
  display: flex; align-items: center; gap: 12px;
}
.toast.toast-error { background: var(--danger); color: #fff; }
.toast[hidden] { display: none; }
.toast-action {
  background: none; border: none; color: #8fd6ac;
  font-weight: 700; padding: 0; width: auto; margin: 0; cursor: pointer;
}

/* --- group-by toggle --- */
.pantry-toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.pantry-toolbar .segmented { margin-bottom: 0; flex: 0 0 auto; }
#pantry-search { flex: 1; min-width: 140px; margin-bottom: 0; width: auto; }
.segmented { display: flex; gap: 0; margin-bottom: 16px; max-width: 320px; }
.seg {
  flex: 1;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 0;
  font-weight: 600;
  margin: 0;
}
.seg:first-child { border-radius: 8px 0 0 8px; }
.seg:last-child { border-radius: 0 8px 8px 0; border-left: none; }
.seg.active { background: var(--green); color: #fff; border-color: var(--green); }

/* --- pantry layout: categories left, items right --- */
.pantry-layout { display: flex; gap: 16px; align-items: flex-start; }
.cat-list { flex: 0 0 170px; display: flex; flex-direction: column; gap: 6px; }
.items-panel { flex: 1; min-width: 0; }

.cat-btn {
  width: 100%;
  text-align: left;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.cat-btn .count { color: var(--muted); font-weight: 400; }
.cat-btn.active { background: var(--green-soft); border-color: var(--green); color: var(--green); font-weight: 600; }
.cat-btn.active .count { color: var(--green); }
.cat-btn.soon { border-color: var(--danger); color: var(--danger); }
.cat-btn.soon .count { color: var(--danger); }
.cat-btn.soon.active { background: #f7e8e8; }

.group-head { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.group-head:first-child { margin-top: 0; }

/* --- item rows --- */
.items { list-style: none; margin: 0; padding: 0; }
.items li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.items li:active { background: #fafaf8; }
.items .info { flex: 1; min-width: 0; }
.items .name { font-weight: 600; }
.items .meta { color: var(--muted); font-size: 14px; }
.items .expiry { font-size: 14px; color: var(--muted); }
.items .expiry.expiry-warn { color: var(--amber); }
.items .expiry.expiry-soon, .items .expiry.expired { color: var(--danger); font-weight: 600; }
.items .chevron { color: var(--line); font-size: 20px; }

/* --- quantity stepper on item rows --- */
.qty-ctrl { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.qty-btn {
  width: 34px; height: 34px; padding: 0; margin: 0;
  background: var(--green-soft); color: var(--green);
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 18px; font-weight: 700; line-height: 1;
}
.qty-val { min-width: 44px; text-align: center; font-size: 14px; color: var(--ink); }
.btn-mini {
  width: auto; padding: 2px 10px; margin: 0 0 0 4px;
  font-size: 13px; border-radius: 6px;
  background: var(--green-soft); color: var(--green); border: 1px solid var(--green);
}

.muted { color: var(--muted); text-align: center; padding: 24px 0; }

/* --- bottom tab bar --- */
.tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  z-index: 5;
}
.tab {
  flex: 1;
  background: none;
  color: var(--muted);
  border: none;
  border-radius: 0;
  padding: 16px;
  font-weight: 600;
}
.tab.active { color: var(--green); box-shadow: inset 0 2px 0 var(--green); }

/* --- edit modal --- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 10;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bg);
  width: 100%; max-width: 520px;
  border-radius: 14px 14px 0 0;
  padding: 16px;
  max-height: 90vh; overflow: auto;
}
.modal-card h2 { margin: 0 0 12px; font-size: 18px; }
.modal-actions { display: flex; gap: 8px; margin-top: 4px; }
.modal-actions button { flex: 1; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); }

/* --- quick-add staples --- */
.staples-box { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.staples-grid { margin-bottom: 10px; }
.staples-heading { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.staples-heading:first-child { margin-top: 0; }
.staples-group { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 12px; }
.staple-check { display: flex; align-items: center; gap: 6px; font-size: 15px; padding: 5px 0; cursor: pointer; }
.staple-check input { width: auto; margin: 0; accent-color: var(--green); }
.staple-check.have { color: var(--muted); cursor: default; }
.staple-check.have .have-mark { color: var(--green); font-weight: 700; }

/* --- recipes --- */
.recipe-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.recipe-bar input { flex: 1; margin-bottom: 0; }
.recipe-bar .btn-inline { flex: 0 0 auto; width: auto; padding: 12px 14px; margin-bottom: 0; }
.recipe-filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.recipe-filters .cat-btn { width: auto; white-space: nowrap; padding: 8px 12px; font-size: 14px; }

.recipe-list { list-style: none; margin: 0; padding: 0; }
.recipe-list li {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.recipe-list li:active { background: #fafaf8; }
.recipe-thumb-wrap { flex: 0 0 56px; }
.recipe-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; display: block; }
.recipe-thumb-placeholder { width: 56px; height: 56px; border-radius: 8px; background: var(--line); }

.seed-bar { text-align: center; margin-top: 16px; }
.seed-bar .hint { margin-bottom: 8px; }

textarea { font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: 8px; width: 100%; margin-bottom: 8px; resize: vertical; background: #fff; }
.import-box { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Recipe detail widens the main container so the two-column layout has room. */
body.wide-view main { max-width: 1100px; }

#rd-content { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }

/* --- Header: image left, title/description right (Cookpad-style) --- */
.rd-header { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; margin-bottom: 24px; }
.rd-header-img { position: relative; }
.rd-img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; }
.rd-header-img-empty { display: none; }
.rd-header-body { min-width: 0; }
.rd-title { margin: 0 0 6px; font-size: 28px; line-height: 1.2; }
.rd-meta { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.rd-description { margin: 0 0 12px; line-height: 1.55; color: var(--ink); }
.rd-source { margin: 0; }
.rd-source a { color: var(--green); font-size: 14px; }

/* --- Body: ingredients | steps --- */
.rd-body { display: grid; grid-template-columns: 320px 1fr; gap: 32px; margin-bottom: 24px; }
.rd-col { min-width: 0; }
.rd-col-heading { margin: 0 0 4px; font-size: 20px; }
.rd-servings, .rd-time { color: var(--muted); font-size: 13px; margin: 0 0 12px; display: flex; align-items: center; gap: 4px; }

.rd-ings { margin: 0; padding: 0; list-style: none; }
.rd-ings li { padding: 10px 0; border-bottom: 1px dotted var(--line); display: flex; align-items: baseline; gap: 8px; line-height: 1.4; }
.rd-ings li:last-child { border-bottom: none; }
.rd-ings .stock-icon { flex-shrink: 0; font-weight: 700; font-size: 14px; width: 18px; text-align: center; }
.rd-ings .in-stock .stock-icon { color: var(--green); }
.rd-ings .not-in-stock .stock-icon { color: var(--danger); }
.rd-ings .not-in-stock { opacity: .7; }

.rd-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.rd-step {
  counter-increment: step;
  position: relative;
  padding: 6px 0 14px 44px;
  min-height: 32px;
  line-height: 1.55;
}
.rd-step::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 2px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--muted); color: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}

/* --- Tips / notes / rating --- */
.rd-tips-section, .rd-notes-section, .rd-rating-section {
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line);
}
.rd-tip { margin: 0 0 8px; line-height: 1.5; }
.rd-notes { color: var(--muted); font-style: italic; margin: 0; }

.cookable-btn.active { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.recipe-list li.cookable-ready { border-color: var(--green); }

/* "a model rewrote this" marker — the untouched import stays in version history */
.ai-btn.active { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.ai-badge {
  display: inline-block; margin-left: 6px; padding: 0 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 16px;
  border: 1px solid var(--amber); border-radius: 4px; color: var(--amber);
  vertical-align: middle;
}

.rd-stars { display: flex; gap: 4px; margin: 4px 0 12px; }
.star-btn { background: none; border: none; font-size: 28px; color: var(--muted); cursor: pointer; padding: 0 2px; line-height: 1; width: auto; }
.star-btn.filled { color: var(--amber); }
.rd-review { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; resize: vertical; background: var(--card); color: var(--ink); margin-bottom: 8px; }

/* --- units toggle --- */
.rd-units-bar { display: flex; justify-content: flex-end; gap: 0; margin-bottom: 10px; }
.units-btn {
  width: auto; padding: 5px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--card); color: var(--muted); border: 1px solid var(--line); margin-bottom: 0;
}
.units-btn:first-child { border-radius: 8px 0 0 8px; border-right: none; }
.units-btn:last-child { border-radius: 0 8px 8px 0; }
.units-btn.active { background: var(--green-soft); color: var(--green); border-color: var(--green); }

/* --- Improve with AI (optimise) --- */
.rd-optimize, .rd-versions { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.rd-optimize-row { display: flex; gap: 8px; margin: 10px 0 8px; }
.rd-optimize-goal { flex: 1; margin-bottom: 0; }
.rd-optimize-row .btn-inline { flex: 0 0 auto; width: auto; padding: 12px 18px; margin-bottom: 0; }
.rd-optimize-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-chip { background: var(--card); color: var(--muted); border: 1px solid var(--line); padding: 5px 11px; font-size: 13px; border-radius: 20px; cursor: pointer; width: auto; margin-bottom: 0; }
.opt-chip:active { background: var(--green-soft); color: var(--green); border-color: var(--green); }

/* proposal preview */
.rd-proposal { margin-top: 16px; border: 2px solid var(--green); border-radius: 12px; padding: 16px; background: var(--green-soft); }
.rd-proposal-title { margin: 0 0 4px; font-size: 16px; }
.rd-proposal-summary { margin: 0 0 12px; line-height: 1.5; }
.rd-proposal-content { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.rd-proposal-content .rd-header { margin-bottom: 16px; }
.rd-proposal-content .rd-body { margin-bottom: 0; }

/* --- duplicate review queue --- */
.review-banner {
  display: block; width: 100%; margin: 0 0 10px; padding: 10px 12px;
  background: var(--green-soft); color: var(--green);
  border: 1px solid var(--green); border-radius: 10px;
  font-weight: 600; font-size: 14px; cursor: pointer; text-align: left;
}
.rvd-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.rvd-side { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.rvd-side-candidate { border-color: var(--green); }
.rvd-side-title { margin: 0 0 12px; font-size: 15px; color: var(--green); }
/* Inside a half-width card the detail layout stacks: image above, ings above steps. */
.rvd-side .rd-header { grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
.rvd-side .rd-body { grid-template-columns: 1fr; gap: 20px; }
@media (max-width: 900px) {
  .rvd-compare { grid-template-columns: 1fr; }
}
.rd-proposal-content .rd-title { font-size: 20px; }
.rd-proposal-actions { display: flex; gap: 8px; margin-top: 14px; }
.rd-proposal-actions .btn-inline { width: auto; flex: 1; }
.rd-proposal-actions .btn-ghost { width: auto; flex: 0 0 auto; padding: 12px 18px; }

/* --- version history --- */
.rd-version-list { list-style: none; margin: 12px 0 0; padding: 0; }
.rd-version { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.rd-version.active { border-color: var(--green); background: var(--green-soft); }
.rd-version-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rd-version-label { font-weight: 600; }
.rd-version-meta { color: var(--muted); font-size: 12px; }
.rd-version-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.rd-version-actions .btn-inline { width: auto; padding: 7px 14px; margin: 0; font-size: 14px; }
.rd-version-actions .btn-ghost { width: auto; padding: 7px 10px; margin: 0; font-size: 13px; }
.rd-version-current { color: var(--green); font-weight: 700; font-size: 13px; }
.rd-version-del { color: var(--danger); }

/* Narrow screens: stack the two columns and shrink the header image */
@media (max-width: 720px) {
  #rd-content { padding: 12px; }
  .rd-header { grid-template-columns: 1fr; gap: 12px; }
  .rd-img { aspect-ratio: 16 / 10; max-height: 260px; }
  .rd-body { grid-template-columns: 1fr; gap: 20px; }
  .rd-title { font-size: 22px; }
  .rd-optimize-row { flex-direction: column; }
  .rd-optimize-row .btn-inline { width: 100%; }
}

.photo-import-btn { background: var(--green-soft); color: var(--green); border: 1px dashed var(--green); width: 100%; }

/* --- ingredient finder --- */
.ing-finder-controls { margin-bottom: 12px; }
.ing-chip-area { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ing-chip {
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  padding: 6px 12px; font-size: 14px; border-radius: 20px; cursor: pointer; width: auto;
}
.ing-chip.active { background: var(--green-soft); color: var(--green); border-color: var(--green); font-weight: 600; }
.ing-chip-x { margin-left: 4px; font-weight: 700; }
.ing-match-bar { height: 4px; background: var(--line); border-radius: 2px; margin: 4px 0 2px; }
.ing-match-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width .3s; }
.ing-match-detail { font-size: 12px; color: var(--muted); }

/* --- AI planner --- */
.ai-quick-actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.ai-action {
  flex: 1; min-width: 100px; background: var(--green-soft); color: var(--green);
  border: 1px solid var(--green); font-size: 14px; font-weight: 600; padding: 10px 8px;
}
.ai-action:active { background: var(--green); color: #fff; }
.ai-chat {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; min-height: 200px; max-height: 50vh; overflow-y: auto; margin-bottom: 8px;
}
.ai-msg { margin-bottom: 10px; padding: 8px 12px; border-radius: 8px; white-space: pre-wrap; line-height: 1.5; font-size: 15px; }
.ai-msg-user { background: var(--green-soft); color: var(--green); text-align: right; margin-left: 40px; }
.ai-msg-ai { background: #f0f0ee; margin-right: 40px; }
.ai-loading { color: var(--muted); font-style: italic; }
.recipe-link { color: var(--green); text-decoration: underline; cursor: pointer; font-weight: 600; }
.ai-input-bar { display: flex; gap: 8px; }
.ai-input-bar input { flex: 1; margin-bottom: 0; }
.ai-input-bar .btn-inline { flex: 0 0 auto; width: auto; padding: 12px 14px; margin-bottom: 0; }
.ai-connected { color: var(--green); }
.ai-offline { color: var(--danger); }

.login-error { color: var(--danger); }

/* --- narrow screens: categories become a scrollable chip row on top --- */
@media (max-width: 600px) {
  .pantry-layout { flex-direction: column; }
  .cat-list {
    flex: none;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
  }
  .cat-btn { width: auto; white-space: nowrap; }
  .modal-card { border-radius: 14px; margin: 0 8px 8px; }
}

/* --- dark mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --card: #1f1f1e;
    --ink: #e8e8e5;
    --muted: #9a9a94;
    --green: #4aa873;
    --green-soft: #1d3226;
    --line: #33332f;
    --danger: #e06c6c;
    --amber: #d9a520;
    --amber-soft: #3a3220;
  }
  input, select, textarea, .btn-ghost { background: #262624; color: var(--ink); border-color: var(--line); }
  .items li:active, .recipe-list li:active { background: #242422; }
  .ai-msg-ai { background: #262624; }
  .cat-btn.soon.active { background: #3a2323; }
  .toast { background: #e8e8e5; color: #161615; }
  .toast-action { color: #2f7d4f; }
  .qr-img { background: #fff; }                /* QR must stay scannable */
}

/* --- computed plan check (facts the model gets wrong, recomputed) --- */
.plan-check {
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 10px;
  background: var(--card);
  padding: 10px 12px;
  margin: 4px 0 10px;
  font-size: 14px;
}
.plan-check-head {
  font-weight: 600;
  color: var(--green);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.plan-check-sub { color: var(--muted); margin: 6px 0 4px; }
.plan-warn {
  color: var(--danger);
  margin: 2px 0;
}
.plan-buy { margin: 0; padding-left: 18px; }
.plan-buy li { margin: 2px 0; }
.plan-for { color: var(--muted); font-size: 13px; }

/* --- saved planner conversations --- */
.ai-history-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.ai-history {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); margin-bottom: 10px; max-height: 260px; overflow: auto;
}
.ai-history[hidden] { display: none; }
.ai-history ul { list-style: none; margin: 0; padding: 0; }
.ai-history li {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.ai-history li:last-child { border-bottom: none; }
.ai-history .h-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-history .h-meta { color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.ai-history .h-del {
  width: auto; margin: 0; padding: 2px 8px; font-size: 13px;
  background: none; color: var(--muted); border: 1px solid var(--line); border-radius: 6px;
}
.ai-history .h-empty { padding: 12px; color: var(--muted); }

/* --- recipe-count toggle --- */
#recipe-count-toggle { flex: 0 0 auto; align-self: center; }
#recipe-count-toggle.active {
  background: var(--green); color: #fff; border-color: var(--green);
}

/* --- infinite scroll sentinel on the recipe list --- */
.recipe-sentinel {
  list-style: none; text-align: center; color: var(--muted);
  padding: 14px; font-size: 14px;
}
