/* CookGrams design
   "Molten amber": a near-black page, the wordmark with three step cards, and one centered charcoal panel.
   Amber for buttons, selected things and the protein number, white text, bold DM Sans.
   Colours are defined once here as "variables" and reused everywhere. */
/* DM Sans (SIL Open Font License, see fonts/DM-Sans-OFL.txt), stored with CookGrams so no font service is contacted. */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("fonts/dm-sans.woff2") format("woff2-variations"), url("fonts/dm-sans.woff2") format("woff2");
}
:root {
  color-scheme: dark;
  --page: #0C0B09;        /* near-black page background */
  --panel: #171512;       /* charcoal content panel and cards */
  --primary: #FFA51F;     /* amber: buttons, selected things */
  --primary-dark: #F09400;/* the same amber when you hover */
  --on-accent: #0C0B09;   /* text on amber buttons */
  --accent-text: #FFB547; /* amber for text and icons: links, selected labels */
  --sage: rgba(255, 165, 31, .12); /* soft amber tint: highlights and notices */
  --ink: #FFFFFF;         /* white: headings */
  --text: #E8E4DD;        /* body text */
  --muted: #A39D93;       /* supporting text */
  --faint: #7D776E;       /* inactive things and small notes */
  --line: #29261F;        /* subtle borders */
  --line-strong: #36322A; /* borders around buttons and fields */
  --soft: #201D18;        /* slightly lighter fill */
  --disabled: #2B2822;    /* buttons you can't press yet */
  --amber: #FFA51F;       /* the protein number on recipe cards */
  --radius-panel: 28px;
  --radius: 16px;
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--page);
  color: var(--text);
  line-height: 1.5;
  padding: 28px 16px 48px;
}

/* ---------- Above the panel ---------- */
.masthead { max-width: 650px; margin: 0 auto 18px; padding: 0 4px; }
.wordmark { font-weight: 700; font-size: 1rem; letter-spacing: .02em; color: var(--ink); margin-bottom: 14px; }
.steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; }
.step-link {
  border: 0; background: none; padding: 4px 0; font: inherit; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: baseline; gap: 6px;
}
.step-link .num { font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--faint); }
.step-link:hover:not(:disabled) { color: var(--ink); }
.step-link.current { color: var(--ink); font-weight: 600; }
.step-link.current .num { color: var(--ink); }
.step-link:disabled { color: var(--faint); cursor: default; }
.arrow { color: var(--faint); }

/* ---------- The panel ---------- */
.shell {
  max-width: 650px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 44px 48px;
}
.footnote { max-width: 650px; margin: 16px auto 0; padding: 0 4px; font-size: .8rem; color: var(--muted); }
.footnote strong { color: var(--text); font-weight: 600; }

/* Mobile: the panel fills the width, with comfortable margins */
@media (max-width: 600px) {
  body { padding: 20px 14px 40px; }
  .shell { padding: 28px 20px; border-radius: 18px; }
}

/* ---------- Typography ---------- */
h1, h2, h3 { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
h1 { margin: 0; font-size: 1.6rem; line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 32px 0 10px; }
.eyebrow { margin: 0 0 6px; font-size: .8rem; color: var(--muted); }
.lead { margin: 6px 0 28px; color: var(--muted); }
.msg { min-height: 1.2em; font-size: .88rem; color: var(--muted); margin: 8px 0 0; }

/* ---------- Fields ---------- */
.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field-label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: 6px; padding: 0; }
.field-help { margin: -2px 0 8px; font-size: .85rem; color: var(--muted); }
textarea, input, select {
  width: 100%; font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 12px;
}
textarea::placeholder, input::placeholder { color: var(--faint); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.with-unit { position: relative; }
.with-unit input { padding-right: 48px; }
.with-unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }
.prefs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .prefs { grid-template-columns: 1fr; gap: 0; } }

/* Add one item: Item | Amount | Unit */
.add-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.add-grid .field { margin: 0; }
@media (max-width: 480px) {
  .add-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .add-grid .item-field { grid-column: 1 / -1; }
}
.field-error { margin: 6px 0 0; font-size: .85rem; color: var(--ink); font-weight: 600; }
.field-error::before { content: "! "; }
input[aria-invalid="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.add-btn {
  margin-top: 14px; background: var(--primary); color: var(--on-accent); border: 1px solid var(--primary);
  padding: 10px 18px; font-weight: 600;
}
.add-btn:hover { background: var(--primary-dark); }

/* Quick add: tap common ingredients by category */
.qa-count {
  position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--soft); border-radius: 10px; padding: 9px 12px; font-size: .9rem; color: var(--text);
  box-shadow: 0 -8px 0 var(--panel), 0 6px 0 var(--panel); /* covers chips scrolling past it */
}
.qa-count strong { color: var(--ink); }
.qa-saved { font-size: .8rem; color: var(--muted); }
.qa-cat { margin: 18px 0 8px; font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.qa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qa-chip {
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 7px 13px; font-size: .9rem;
}
.qa-chip::before { content: "+ "; color: var(--muted); }
.qa-chip:hover { border-color: var(--primary); }
.qa-chip.on { background: var(--primary); color: var(--on-accent); border-color: var(--primary); }
.qa-chip.on::before { content: "✓ "; color: var(--on-accent); }
.paste-box { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

/* Meal choice: radio buttons styled as pills */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-block; border: 1px solid var(--line); padding: 8px 16px; border-radius: 999px; font-size: .92rem; }
.chip input:checked + span { background: var(--primary); color: var(--on-accent); border-color: var(--primary); }
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Buttons ---------- */
button { font: inherit; cursor: pointer; border-radius: 10px; }
.primary {
  background: var(--primary); color: var(--on-accent); border: 1px solid var(--primary);
  padding: 14px 20px; font-weight: 600; width: 100%; font-size: 1rem;
}
.primary:hover:not(:disabled) { background: var(--primary-dark); }
.primary:disabled { background: var(--disabled); border-color: var(--disabled); cursor: not-allowed; }
.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); padding: 10px 16px; font-weight: 500; }
.secondary:hover { border-color: var(--primary); }
.link { background: none; border: 0; padding: 6px 2px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: .9rem; }
.link:hover { color: var(--ink); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.next { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; align-items: center; }

/* Suggested / Favourites switch */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 24px; }
.seg { border: 0; background: none; padding: 7px 14px; color: var(--muted); font-size: .9rem; border-radius: 7px; }
.seg.current { background: var(--soft); color: var(--ink); font-weight: 600; }

/* ---------- Fridge list ---------- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 32px; }
.section-head h2 { margin: 0 0 10px; }
.count { color: var(--muted); font-weight: 400; font-size: .9rem; }
.fridge-list, .cooked-list { list-style: none; padding: 0; margin: 0; }
.fridge-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 10px; }
.fridge-item.finished { opacity: .5; }
.fridge-item.finished .item-name { text-decoration: line-through; }
.item-name { font-weight: 600; color: var(--ink); }
.item-meta { font-size: .85rem; color: var(--muted); }
.remove { border: 0; background: none; color: var(--muted); font-size: 1.2rem; padding: 4px 8px; }
.remove:hover { color: var(--ink); }
.status-group { grid-column: 1 / -1; display: flex; gap: 4px; }
.status-btn { flex: 1; border: 1px solid var(--line); background: var(--panel); color: var(--muted); padding: 6px 4px; font-size: .82rem; }
.status-btn.on { background: var(--primary); color: var(--on-accent); border-color: var(--primary); }
.badge { display: inline-block; font-size: .72rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-left: 4px; vertical-align: middle; font-weight: 400; }
.empty { color: var(--muted); padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); margin: 0; }

.history { margin-top: 24px; font-size: .92rem; }
.history summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.cooked-list li { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.cooked-list .when { color: var(--muted); font-size: .82rem; }

/* ---------- Recipe options: ingredient match cards ---------- */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: block; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer;
}
.option:hover { border-color: var(--line-strong); }
.option.selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.option-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.option-head input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.option-title { font-weight: 600; color: var(--ink); }
.option-meta { display: block; font-size: .85rem; color: var(--muted); margin: 2px 0 12px; }
.macro-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.macro-grid .macro { background: var(--soft); border-radius: 8px; padding: 7px 4px; text-align: center; font-size: .75rem; color: var(--muted); }
.macro-grid .macro b { display: block; font-size: 1rem; color: var(--ink); font-weight: 600; }
.macro-note { display: block; font-size: .75rem; color: var(--faint); margin: 6px 0 12px; }
.match-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.notice { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: .88rem; color: var(--text); margin: 0 0 10px; }

/* Compact nutrition line */
.nutri { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: var(--muted); }
.nutri b { color: var(--ink); font-weight: 600; }
.nutri .per { color: var(--faint); }

/* ---------- Cook stage ---------- */
.recipe-meta { margin: 6px 0 14px; font-size: .88rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nutri-box { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin: 0 0 6px; }
.note { font-size: .78rem; color: var(--faint); margin: 0 0 16px; }
.alert { border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin: 8px 0; background: var(--soft); color: var(--text); }
.alert.bad { border: 1px solid var(--primary); background: none; color: var(--ink); }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .93rem; display: flex; gap: 10px; }
.ing-list li:last-child { border-bottom: 0; }
.ing-list .icon { width: 1.2em; flex: none; text-align: center; color: var(--muted); }
.ing-list .flag { color: var(--muted); font-size: .82rem; }
.bad .icon, .bad .flag { color: var(--ink); font-weight: 700; }
.steps-list { padding-left: 1.3em; margin: 0; }
.steps-list li { margin-bottom: 8px; padding-left: 4px; }

/* Inventory confirmation */
.confirm-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.confirm-row .check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.confirm-row .check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.confirm-row strong { color: var(--ink); display: block; }
.confirm-row .sub { display: block; font-size: .84rem; color: var(--muted); }
.confirm-row .after { display: flex; flex-direction: column; font-size: .78rem; color: var(--muted); gap: 4px; }
.confirm-row .after select { width: auto; padding: 7px 10px; font-size: .9rem; }
.confirm-row.unused .after, .confirm-row.unused .sub { opacity: .4; }
@media (max-width: 480px) {
  .confirm-row { grid-template-columns: 1fr; }
  .confirm-row .after { flex-direction: row; align-items: center; padding-left: 32px; gap: 8px; }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--primary); color: var(--on-accent); padding: 10px 18px; border-radius: 999px;
  font-size: .9rem; max-width: calc(100vw - 32px);
}

/* ---------- Cooking mode (one step at a time) ---------- */
.cook-top { font-size: .85rem; color: var(--muted); }
.progress { display: flex; gap: 4px; margin: 12px 0 16px; }
.progress span { flex: 1; height: 4px; border-radius: 999px; background: var(--line); }
.progress span.done { background: var(--primary); }
.step-info { margin-bottom: 24px; font-size: .92rem; }
.step-info summary { cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; width: fit-content; }
.step-info summary:hover { color: var(--ink); }
.step-info[open] summary { margin-bottom: 12px; }
.step-text { font-size: 1.4rem; line-height: 1.45; color: var(--ink); font-weight: 500; margin: 4px 0 20px; }
@media (max-width: 480px) { .step-text { font-size: 1.25rem; } }
.for-step-label { font-size: .8rem; color: var(--muted); margin: 0 0 6px; }
.for-step { display: flex; flex-wrap: wrap; gap: 6px; }
.use-chip { font-size: .85rem; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 12px; }
.use-chip.missing { border-style: dashed; border-color: var(--primary); }
.step-nav { display: flex; gap: 10px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.step-nav .secondary { flex: 1; }
.step-nav .primary { flex: 2; width: auto; }
#stage-cook .macro-grid { margin-bottom: 6px; }

/* Gram estimates: secondary information, used for nutrition */
.grams { color: var(--faint); font-size: .85em; }

/* Optional ingredients: tick to include */
.optional-row { padding: 8px 0; }
.opt-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.opt-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.use-chip.skipped { color: var(--muted); border-style: dotted; }

/* Missing essential ingredients on "Before you start" */
.missing-box { border: 1px solid var(--primary); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.missing-box p { margin: 0; }
.missing-box .row { margin-top: 10px; }
.have-form { margin-top: 12px; }
.add-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.add-grid.two .field { grid-column: auto; }
.blocked-note { margin: 0; color: var(--muted); font-size: .92rem; text-align: center; }

/* "Update your fridge": editable amounts */
.confirm-row { grid-template-columns: 1fr auto; }
.confirm-row .check { align-items: center; }
.used-field { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.used-field input { width: 90px; padding: 7px 10px; }
.confirm-row .sub, .left-line, .confirm-row .field-error { grid-column: 1 / -1; margin: 0; }
.left-line { font-size: .88rem; color: var(--ink); }
.confirm-row .after { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; }
.confirm-row.unused .used-field, .confirm-row.unused .after { opacity: .4; }
.confirm-nutri { font-size: .82rem; color: var(--muted); margin: 16px 0 0; }
.change-list { margin: 0 0 8px; padding-left: 1.2em; color: var(--text); }
.change-list li { margin-bottom: 4px; }
.small-link { font-size: .82rem; padding: 2px 0; }
@media (max-width: 480px) {
  .confirm-row { grid-template-columns: 1fr; }
  .confirm-row .after { padding-left: 0; }
}

/* Discover card: ingredients whose amount you should check */
.check-line { display: block; font-size: .82rem; color: var(--ink); margin-top: 10px; }

/* Fridge list: editable amounts */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.item-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.amount-control { display: flex; align-items: center; gap: 6px; font-size: .92rem; color: var(--ink); }
.step-btn {
  width: 32px; height: 32px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  border-radius: 8px; font-size: 1.05rem; line-height: 1; padding: 0;
}
.step-btn:hover { border-color: var(--primary); }
.amount-text { min-width: 72px; text-align: center; }
.amount-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.amount-form input { width: 84px; padding: 6px 8px; }
.amount-form select { width: auto; padding: 6px 8px; }
.amount-form .unit { color: var(--muted); font-size: .88rem; }
.fridge-item .field-error { margin: -4px 0 0; }
.fridge-item .status-group { grid-column: auto; }
@media (max-width: 480px) {
  .item-top { grid-template-columns: minmax(0, 1fr) auto; }
  .item-top .amount-control { grid-column: 1 / -1; grid-row: 2; }
}

/* AI suggestions */
.ai-panel { margin-top: 8px; }
.find-btn, #find-btn { margin-top: 4px; }
#find-btn:disabled { background: var(--disabled); border-color: var(--disabled); cursor: progress; }
.ai-status { font-size: .84rem; color: var(--muted); margin: 8px 0 0; }
.ai-error { border: 1px solid var(--primary); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: .9rem; color: var(--ink); }
.ai-error p { margin: 0 0 4px; }
.rejected { margin: 6px 0 0; padding-left: 1.2em; }
.rejected li { margin-bottom: 4px; }
.source.ai { font-weight: 600; color: var(--ink); }
.nutri-missing { display: block; margin: 0 0 10px; }
.segmented { flex-wrap: wrap; }

/* "Generate recipes" loading state */
.ai-loading { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.ai-loading-title { margin: 0; font-weight: 600; color: var(--ink); }
.ai-loading-sub { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.spinner {
  width: 22px; height: 22px; flex: none; margin-top: 1px;
  border: 2.5px solid var(--line); border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* One short note under the "For you" results */
.results-note { font-size: .8rem; color: var(--muted); margin: 12px 0 0; }
.target-note { margin: 4px 0 14px; color: var(--ink); }

/* Whole-recipe total under the per-serving nutrition boxes */
.whole-recipe { display: block; font-size: .85rem; color: var(--ink); margin: 8px 0 0; }

/* "Nutrition details" (collapsed by default) */
.nutri-details { font-size: .84rem; color: var(--text); }
.nutri-details summary { cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; width: fit-content; font-size: .82rem; }
.nutri-details summary:hover { color: var(--ink); }
.nutri-details-body { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin-top: 6px; }
.nutri-details-body p { margin: 0 0 6px; }
.nutri-details-body p:last-child { margin-bottom: 0; }
.nutri-details-body a { color: var(--ink); }
.nutri-details-body .hint-line { color: var(--muted); }
.ing-list .nutri-details { display: block; margin-top: 2px; }
.optional-row .nutri-details { margin: 4px 0 0 28px; }

.nutri-details-body .src { color: var(--muted); }
.nutri-details-body .type-note { color: var(--ink); }

/* Type pills inside Nutrition details (one tap to change type) */
.nutri-details-body .type-label { color: var(--muted); margin: 0 0 4px; }
.type-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.type-pill { border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: .8rem; }
.type-pill:hover { border-color: var(--primary); }
.type-pill[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }

/* "Add one item" / "Add a list" switch on the Fridge step */

/* "Practice mode" label next to the wordmark (practice server only) */
.mode-badge { font-weight: 600; color: var(--ink); border-color: var(--primary); margin-left: 6px; }

/* Account area at the top (only when accounts are set up) */
.account { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.account-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.account-row strong { color: var(--ink); font-weight: 600; }
.account-hint { color: var(--faint); }
.account-status { font-size: .78rem; color: var(--faint); }
.account-msg { margin: 6px 0 0; color: var(--ink); }
.account-msg.is-error { font-weight: 600; border-left: 2px solid var(--primary); padding-left: 8px; }
.account-loading { margin: 0; color: var(--muted); }
.account-row + .account-loading { margin-top: 6px; }
.account-menu-btn { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .85rem; color: var(--ink); cursor: pointer; }
.account-menu-btn:hover, .account-menu-btn[aria-expanded="true"] { border-color: var(--primary); }
.account-menu { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-top: 8px; max-width: 320px; }
.account-menu-label { margin: 0; font-size: .78rem; color: var(--faint); }
.account-email { margin: 0 0 4px; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.account-form-title { margin: 0 0 8px; font-weight: 600; color: var(--ink); }
.account-switch { color: var(--muted); }
.account-switch .link { padding: 0; }
.account-gap { margin-top: 12px; }
.account-form input { margin-bottom: 6px; }
.account-form .field-help { margin: 0 0 4px; }
.account-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.account-actions .add-btn { margin-top: 0; }
.account-notice { font-size: .78rem; color: var(--faint); margin-top: 8px; }
.account-form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.account-form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.account-form-row input { flex: 1 1 220px; width: auto; }
.account-form-row .add-btn { margin-top: 0; }
.account-form .field-help { margin: 6px 0 0; }
.account-ask { background: var(--panel); border: 1px solid var(--primary); border-radius: var(--radius); padding: 12px 14px; margin-top: 8px; color: var(--ink); }
.account-ask p { margin: 0; }
.account-ask .add-btn { margin-top: 0; }

/* ---------- Privacy Policy and Terms of Use ---------- */
.legal-home { display: inline-block; margin-bottom: 0; text-decoration: none; }
.legal h1 { margin-top: 0; }
.legal h2 { font-size: 1.05rem; color: var(--ink); margin: 26px 0 6px; }
.legal p, .legal ul { margin: 0 0 10px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal a, .legal-links a, .account-agree a { color: var(--ink); }
.legal-date { color: var(--muted); font-size: .9rem; }
.legal-foot { margin-top: 28px !important; font-size: .9rem; }
.legal-links { max-width: 650px; margin: 18px auto 0; text-align: center; color: var(--muted); font-size: .85rem; }
.legal-links a { color: var(--muted); }


/* ---------- Sign-up agreement ---------- */
.account-tracking { font-size: .78rem; margin-top: 8px !important; }
.account-agree { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: .85rem; color: var(--text); }
.account-agree input { width: auto; margin: 3px 0 0; flex: none; }
.account-agree span { flex: 1; min-width: 0; }
.account-menu .account-agree { margin-bottom: 8px; }

/* ---------- Your taste ---------- */
/* "How was it?" on the Fridge updated screen */
.rate { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.rate-q { margin: 0 0 8px; font-weight: 600; color: var(--ink); font-size: .95rem; }
.rate-q .sub, .taste-box .sub { font-weight: 400; font-size: .82rem; color: var(--muted); }
.rate-buttons { display: flex; gap: 8px; margin-bottom: 16px; }
.rate-btn { flex: 1; background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); padding: 11px 12px; font-weight: 600; }
.rate-btn:hover { border-color: var(--primary); }
.rate-btn.on { background: var(--primary); color: var(--on-accent); border-color: var(--primary); }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pick { border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: .86rem; }
.pick:hover { border-color: var(--primary); }
.pick.on { background: var(--primary); color: var(--on-accent); border-color: var(--primary); }
.rate-thanks { margin: 4px 0 0; }
/* Summary line and list in Discover */
.taste-box { margin-top: 16px; }
.taste-line { margin: 0; }
.taste-line .link { padding: 0 2px; font-size: .88rem; }
.taste-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px 14px; margin-top: 8px; }
.taste-h { margin: 14px 0 6px; font-weight: 600; color: var(--ink); font-size: .9rem; }
.taste-list { list-style: none; margin: 0; padding: 0; }
.taste-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--ink); }
.taste-list li:last-child { border-bottom: 0; }
.taste-list .remove { border: 0; background: none; color: var(--faint); padding: 4px 6px; flex: none; }
.taste-list .remove:hover { color: var(--ink); }
.avoid-form { margin-top: 4px; }
.avoid-row { display: flex; gap: 8px; }
.avoid-row input { flex: 1; min-width: 0; }
.avoid-row .secondary { flex: none; }

/* Introduction above the Fridge step */
.intro { margin: 0 0 26px; padding: 16px 18px; background: var(--sage); border-radius: var(--radius); }
.intro-title { margin: 0 0 4px; font-size: 1.12rem; font-weight: 600; color: var(--accent-text); letter-spacing: -0.01em; line-height: 1.3; }
.intro-text { margin: 0; color: var(--text); font-size: .95rem; }

/* Fridge: the item's status next to its name (Running low / Finished) */
.status-badge { border: 0; font-weight: 600; padding: 2px 9px; }
.status-badge.low { background: var(--sage); color: var(--accent-text); }
.status-badge.finished { background: var(--soft); color: var(--muted); text-decoration: none; }

/* "Check your email" after signing up */
.account-check p { margin: 0 0 8px; color: var(--text); }
.account-steps { margin: 0 0 8px; padding-left: 1.3em; color: var(--text); }
.account-steps li { margin-bottom: 4px; }

/* ---------- Look: shapes, step cards, meal tiles and icons ----------
   Only how things look. Every button, field and step works as before. */
/* Simple line icons (drawn in index.html and app.js) take the colour of the text around them. */
.i { width: 1.1em; height: 1.1em; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; flex: none; }

/* The "cookgrams." logo (logo.png is dark; the filter shows it in white to match --ink) */
.wordmark { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.logo-img { display: block; height: 28px; width: auto; }
@media (max-width: 600px) { .logo-img { height: 26px; } }

/* The three steps as cards: icon, name and a short description */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.step-link {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 12px 6px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; color: var(--ink); text-align: center;
}
.step-link .i { width: 1.55rem; height: 1.55rem; margin-bottom: 4px; }
.step-name { font-weight: 600; font-size: .95rem; }
.step-sub { font-size: .76rem; color: var(--muted); }
.step-link:hover:not(:disabled) { border-color: var(--primary); color: var(--ink); }
.step-link.current { background: var(--sage); border-color: var(--primary); color: var(--accent-text); font-weight: 600; }
.step-link.current .step-sub { color: var(--accent-text); }
.step-link:disabled { color: var(--faint); background: var(--panel); }
.step-link:disabled .step-sub { color: var(--faint); }

/* Panel, headings and text */
.shell { padding: 40px 44px; box-shadow: none; }
@media (max-width: 600px) { .shell { padding: 28px 20px; border-radius: 22px; } }
h1 { letter-spacing: -0.02em; }
.eyebrow { font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); font-weight: 600; }

/* Fields */
textarea, input, select { background: var(--page); border-color: var(--line); border-radius: 14px; }
.amount-form input, .amount-form select, .used-field input, .confirm-row .after select { border-radius: 10px; }

/* Buttons: soft corners, generous padding */
.primary { border-radius: 16px; padding: 16px 20px; }
.add-btn { border-radius: 14px; padding: 12px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.secondary { border-radius: 14px; }
.add-btn:hover:not(:disabled), .primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.link { color: var(--accent-text); font-weight: 500; text-decoration-color: rgba(255, 181, 71, .45); text-underline-offset: 4px; }
.link:hover { color: var(--primary-dark); }
.step-btn { border-radius: 10px; }
#find-btn { width: 100%; padding: 16px 20px; font-size: 1rem; }

/* Quick add chips: a "+" icon, or a tick when it's in your fridge */
.qa-count { background: var(--page); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.qa-count strong { color: var(--accent-text); }
.qa-cat { font-size: .74rem; letter-spacing: .08em; }
.qa-chips { gap: 8px; }
.qa-chip { display: inline-flex; align-items: center; gap: 6px; border-color: var(--line); padding: 8px 14px; }
.qa-chip::before, .qa-chip.on::before {
  content: ""; width: 14px; height: 14px; background: currentColor; opacity: .6;
  -webkit-mask: var(--qa-icon) center / contain no-repeat; mask: var(--qa-icon) center / contain no-repeat;
  --qa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}
.qa-chip.on::before { opacity: 1; --qa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.qa-chip:hover { border-color: var(--primary); }

/* Meal choice as four icon tiles (Taste stays as round chips) */
.meal-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.meal-tiles .chip span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px 12px; border-radius: 16px; background: var(--panel); border-color: var(--line); color: var(--ink); text-align: center; }
.meal-tiles .chip .i { width: 1.6rem; height: 1.6rem; }
.meal-tiles .chip:hover span { border-color: var(--primary); }
.meal-tiles .chip input:checked + span { background: var(--sage); color: var(--accent-text); border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); font-weight: 600; }
@media (max-width: 420px) { .meal-tiles { gap: 6px; } .meal-tiles .chip span { font-size: .82rem; padding: 12px 2px 10px; } }
.chip span { border-color: var(--line); padding: 8px 16px; }

/* "For you / Favourites" switch */
.segmented { border-radius: 999px; padding: 4px; background: var(--page); }
.seg { border-radius: 999px; padding: 7px 16px; display: inline-flex; align-items: center; gap: 6px; }
.seg.current { background: var(--primary); color: var(--on-accent); font-weight: 500; }

/* Fridge list */
.section-head h2 .i { margin-right: 6px; color: var(--accent-text); }
.section-head .count, .section-head .link { white-space: nowrap; }
.fridge-item { padding: 14px 16px; margin-bottom: 10px; }
.status-group { background: var(--page); border-radius: 12px; padding: 4px; gap: 4px; }
.status-btn { border: 0; background: none; border-radius: 9px; padding: 7px 4px; }
.status-btn.on { background: var(--panel); color: var(--accent-text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.remove { display: inline-flex; align-items: center; justify-content: center; color: var(--faint); border-radius: 8px; padding: 6px; }
.remove:hover { color: var(--ink); background: var(--soft); }
.badge { border-color: var(--line); }

/* Recipe cards */
.option.selected { box-shadow: inset 0 0 0 1px var(--primary); }
.option-meta { display: flex; align-items: center; gap: 5px; }
.macro-grid .macro { background: var(--page); border-radius: 12px; padding: 8px 4px; }
.notice { background: var(--sage); border-radius: 12px; color: var(--text); }
.taste-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--accent-text); }
.taste-line .link { margin-left: auto; }
.taste-panel, .ai-loading, .missing-box, .account-form, .account-menu { border-radius: var(--radius); }

/* "How was it?" and the Fridge updated screen */
.rate-btn { border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.pick { border-color: var(--line-strong); }
.done-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--sage); color: var(--accent-text); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.done-mark .i { width: 1.4rem; height: 1.4rem; }

/* Small things */
.toast { background: var(--primary); }
.legal a, .legal-links a, .account-agree a { color: var(--accent-text); }
.legal-links a { color: var(--muted); }
.account-menu-btn { border-radius: 999px; }

/* "Earlier ideas from …": results from an earlier visit, shown only when you ask */
.earlier-link { display: inline; padding: 0; font-size: inherit; }

/* "Update your fridge": one compact row per ingredient (name · used · status) */
.confirm-note { margin: 0 0 6px; }
.confirm-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 14px; padding: 14px 0; align-items: center; }
.confirm-row select[data-after] { width: auto; padding: 7px 10px; font-size: .9rem; border-radius: 10px; }
.confirm-row.unused select[data-after] { opacity: .4; }
@media (max-width: 480px) {
  /* name and status on the first line, "Used …" underneath */
  .confirm-row { grid-template-columns: minmax(0, 1fr) auto; }
  .confirm-row .check { grid-column: 1; grid-row: 1; }
  .confirm-row select[data-after] { grid-column: 2; grid-row: 1; }
  .confirm-row .used-field { grid-column: 1 / -1; grid-row: 2; padding-left: 32px; }
}

/* ---------- Account menu: email, Account settings, Privacy & data, Log out ---------- */
:root { --danger: #FF6B5E; --danger-dark: #FF8A7F; }
.account-menu { padding: 14px 16px; max-width: 340px; }
.account-links { display: flex; flex-direction: column; margin-top: 8px; border-top: 1px solid var(--line); }
.menu-item { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 11px 2px; font-size: .92rem; color: var(--ink); text-align: left; }
.menu-item:last-child { border-bottom: 0; }
.menu-item:hover { color: var(--accent-text); }
.menu-item span { color: var(--faint); font-size: 1.1rem; }
.account-back { background: none; border: 0; padding: 0 0 8px; color: var(--muted); font-size: .85rem; }
.account-back:hover { color: var(--ink); }
.account-menu .field-help { margin: 0 0 8px; }
.account-danger { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.danger-btn { background: var(--panel); color: var(--danger); border: 1px solid var(--danger); border-radius: 12px; padding: 9px 14px; font-weight: 600; }
.danger-btn:hover:not(:disabled) { background: var(--danger); color: var(--on-accent); }
.danger-btn:disabled { opacity: .6; cursor: not-allowed; }
/* "Delete your account?" box */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .65); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--panel); border-radius: 20px; padding: 22px; width: 100%; max-width: 420px; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); border: 1px solid var(--line); color: var(--text); font-size: .92rem; }
.modal-title { margin: 0 0 8px; font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.modal .field-help a { color: var(--accent-text); }
.modal input { margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.modal .danger-btn { background: var(--danger); color: var(--on-accent); }
.modal .danger-btn:hover:not(:disabled) { background: var(--danger-dark); border-color: var(--danger-dark); }

/* Recipe cards: short availability and warning lines */
.match-row { margin: 10px 0 0; }
.missing-line { color: var(--ink); font-weight: 600; }
.option .check-line { margin-top: 4px; color: var(--muted); }
.card-note { display: block; font-size: .82rem; color: var(--muted); margin: 0 0 4px; }

/* ---------- "Give feedback" card (under your recipes and after cooking) ---------- */
.fb-card { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--primary); background: var(--sage); border-radius: var(--radius); }
.fb-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fb-title { margin: 0; font-weight: 600; color: var(--accent-text); font-size: .95rem; }
.fb-sub { margin: 0; font-size: .82rem; color: var(--text); }
.fb-open { flex: none; border: 0; border-radius: 999px; background: var(--primary); color: var(--on-accent); padding: 8px 14px; font-size: .85rem; font-weight: 600; }
.fb-open:hover { background: var(--primary-dark); }
.fb-close { flex: none; border: 0; background: none; color: var(--muted); padding: 4px; border-radius: 8px; display: inline-flex; }
.fb-close:hover { color: var(--ink); background: var(--panel); }
.fb-form { margin-top: 12px; background: var(--panel); border-radius: 12px; padding: 12px 14px 14px; }
.fb-q { border: 0; margin: 0; padding: 0; min-width: 0; }
.fb-q legend, .fb-label { display: block; font-weight: 600; font-size: .88rem; color: var(--ink); margin: 6px 0 8px; padding: 0; }
.fb-label { margin-top: 14px; }
.fb-label span { font-weight: 400; color: var(--muted); }
.fb-opts { display: flex; gap: 6px; }
.fb-opt { flex: 1; position: relative; cursor: pointer; }
.fb-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.fb-opt span { display: block; text-align: center; border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 4px; font-size: .88rem; color: var(--ink); background: var(--panel); }
.fb-opt input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
.fb-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.fb-form textarea { min-height: 56px; font-size: .9rem; }
.fb-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.fb-actions .add-btn { margin-top: 0; }
.fb-small { margin: 10px 0 0; font-size: .76rem; color: var(--muted); }
.fb-thanks { display: flex; align-items: center; gap: 12px; }
.fb-ok { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--panel); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }

/* Feedback invitation buttons, the small link at the bottom, and the feedback box */
.fb-invite-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.fb-card > .fb-title { margin-bottom: 2px; }
.account-row { align-items: center; }
.account-feedback { padding: 4px 2px; font-size: .85rem; }
.fb-modal { max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; }
.fb-modal .fb-row { align-items: flex-start; }
.fb-modal .fb-form { padding: 0; margin-top: 4px; }
.fb-modal .fb-thanks { margin: 10px 0 0; }
.fb-form .add-btn:disabled { background: var(--disabled); border-color: var(--disabled); cursor: not-allowed; }

/* ===== Returning users: "What's cooking today?" (Discover) and list-first Fridge ===== */
.fridge-summary { margin: 18px 0 24px; }
.summary-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.summary-head h2 { margin: 0 0 10px; font-size: 1rem; }
.summary-head h2 .i { margin-right: 6px; color: var(--accent-text); }
.summary-head .link { white-space: nowrap; }
.fridge-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fridge-chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 12px; font-size: .86rem; color: var(--ink); }
.fridge-chip.low { background: var(--sage); border-color: transparent; color: var(--accent-text); }
.fridge-chip.more { color: var(--muted); }
.home-empty { margin: 0; color: var(--muted); font-size: .9rem; }
.targets-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; padding: 8px 12px; background: var(--page); border: 1px solid var(--line); border-radius: 12px; font-size: .88rem; color: var(--text); }
.targets-line > .i { color: var(--accent-text); }
.prefs-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.prefs-text strong { color: var(--ink); font-weight: 600; }
#prefs-summary { color: var(--muted); font-size: .8rem; }
.targets-line .link { margin-left: auto; white-space: nowrap; }
#filters #prefs { margin-bottom: 16px; }
.home-favs { margin-top: 32px; }
.fav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fav-row { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 10px 12px; color: var(--text); cursor: pointer; font: inherit; }
.fav-row:hover { border-color: var(--primary); }
.fav-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--sage); color: var(--accent-text); display: flex; align-items: center; justify-content: center; flex: none; }
.fav-text { display: flex; flex-direction: column; min-width: 0; }
.fav-title { color: var(--ink); font-weight: 600; font-size: .95rem; }
.fav-meta { color: var(--muted); font-size: .8rem; }
.fav-row > .i:last-child { margin-left: auto; color: var(--faint); flex: none; }

#stage-fridge.returning > .intro, #stage-fridge.returning > .eyebrow,
#stage-fridge.returning > h1, #stage-fridge.returning > .lead { display: none; }
#stage-fridge.returning .section-head { margin-top: 0; }
.add-box { margin-top: 18px; padding: 2px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.add-toggle { width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 0; background: none; border: 0; color: var(--accent-text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.add-toggle .chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.add-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.add-box .add-area { padding-bottom: 14px; }

/* Fridge: your food as chips; tap one to open its editor */
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-list > li { display: contents; }
.chip-list > li.empty { display: block; flex: 1; }
.fchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }
.fchip:hover { border-color: var(--primary); }
.fchip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; }
.fchip.low { background: var(--sage); border-color: transparent; color: var(--accent-text); }
.fchip.low .dot { background: var(--primary); }
.fchip.finished { color: var(--muted); text-decoration: line-through; }
.fchip.finished .dot { background: var(--faint); }
.fchip.sel { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.fridge-editor { margin: 10px 0 0; border-color: var(--primary); }
.fridge-editor.finished { opacity: 1; }
.editor-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.editor-foot .nutri-details { flex: 1; min-width: 0; }
.editor-foot > .link { padding-top: 0; }
.hint { margin: 8px 0 0; font-size: .82rem; color: var(--muted); }
.qa-more { margin-top: 10px; }

/* New users: "Go to Discover" stays at the bottom of the screen */
.first-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; margin: 24px -4px 0; padding: 12px 4px calc(12px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); }
.first-count { font-size: .88rem; color: var(--muted); white-space: nowrap; }
.first-count strong { color: var(--ink); font-size: 1rem; }
.first-bar .primary { width: auto; flex: 1; margin: 0; white-space: nowrap; padding: 14px 16px; }

/* Discover: earlier recipes as a small link under the button */
.ai-earlier { margin: 4px 0 0; font-size: .84rem; color: var(--muted); }
.ai-earlier .link { font-size: .84rem; }
#stage-discover.home #taste-field { margin-top: 0; }
#filters .taste-box { margin: 0 0 16px; }

/* The waitlist field under the "searches used up" line (same field and button as "Avoid") */
.waitlist .avoid-row { margin-top: 8px; }

/* "Add an ingredient to avoid" is a type-in field: hide the ▼ Chrome adds for its suggestions (they still appear as you type) */
#avoid-name::-webkit-calendar-picker-indicator { display: none !important; }

/* Recipe cards: protein is the biggest thing (amber), calories, carbs and fat small underneath */
.option .option-meta { margin: 2px 0 0; }
.option-nutri { display: block; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.protein-row { display: flex; align-items: baseline; gap: 8px; }
.protein-num { font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--amber); }
.protein-num small { font-size: .5em; font-weight: 600; letter-spacing: 0; margin-left: 2px; }
.protein-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--amber); }
.nutri-rest { display: block; margin-top: 6px; font-size: .8rem; color: var(--muted); }
.nutri-rest b { color: var(--text); font-weight: 600; }

/* Molten amber: white logo and bolder type */
.logo-img { filter: brightness(0) invert(1); }
h1 { font-weight: 800; letter-spacing: -0.03em; } /* slightly tighter so bold titles stay on the same lines as before */
.add-btn:disabled, .primary:disabled { color: var(--muted); } /* greyed-out buttons: readable grey text */
h2, h3, .field-label, .prefs-text strong { font-weight: 700; }
.eyebrow, .step-name, .option-title, .protein-label { font-weight: 700; }
.add-btn, .primary { font-weight: 700; }
.meal-tiles .chip input:checked + span { font-weight: 700; }
.protein-num { font-weight: 900; }
.nutri-rest b { font-weight: 700; }

/* Nutrition details: the food's numbers, protein first */
.nutri-values b { color: var(--ink); font-weight: 600; }
.nutri-values b.pro { color: var(--accent-text); font-weight: 700; }
/* Recipe overview (Cook): protein large, the rest small underneath, like the recipe cards */
.macro-hero { display: block; margin: 4px 0 6px; }
/* Recently cooked: each title opens its recipe */
.cooked-open { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; border-radius: 4px; }
.cooked-open .i { color: var(--accent-text); }
.cooked-open:hover { text-decoration: underline; text-underline-offset: 3px; }
/* "We don't recognise …" dialog: both buttons on one line, the same height */
.modal-actions .add-btn { margin-top: 0; }
.modal-actions .secondary { border-radius: 14px; padding: 12px 20px; }

/* Cookie banner: shown until the visitor accepts or declines Google Analytics (consent.js) */
.cookie-banner { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 16px; padding: 14px 16px; box-shadow: 0 12px 36px rgba(0, 0, 0, .55); color: var(--text); font-size: .88rem; }
.cookie-banner p { margin: 0; flex: 1 1 260px; }
.cookie-banner a { color: var(--accent-text); }
.cookie-actions { display: flex; gap: 10px; margin-left: auto; }
.cookie-actions .add-btn { margin-top: 0; width: auto; padding: 10px 20px; }
.cookie-actions .secondary { border-radius: 14px; padding: 10px 18px; }
