/* FridgeToForks — landing page
 * Custom properties mirror packages/shared/tokens.ts. Edit tokens.ts, not here.
 */

:root {
  --c-tomato:      oklch(57.5% 0.182 33.1);
  --c-tomato-deep: oklch(47.5% 0.160 33.1);
  --c-ink:         oklch(26.8% 0.006 34.3);
  --c-ink-muted:   oklch(48.0% 0.008 45.0);
  --c-mint:        oklch(85.5% 0.039 164.7);
  --c-mint-pale:   oklch(94.0% 0.018 164.7);
  --c-paper:       oklch(98.5% 0.003 264.5);
  --c-paper-warm:  oklch(99.2% 0.004 80.0);
  --c-rule:        oklch(90.5% 0.004 60.0);

  --s-ready:      oklch(48.0% 0.120 155.0);
  --s-substitute: oklch(52.0% 0.110 70.0);

  --f-display: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-numeric: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --sp-4: 1rem;  --sp-5: 1.5rem; --sp-6: 2rem;
  --sp-7: 3rem;  --sp-8: 4.5rem; --sp-9: 6.5rem;

  --r-md: 8px; --r-lg: 14px; --r-pill: 999px;
  --m-quick: 140ms cubic-bezier(0.22, 1, 0.36, 1);
  --m-base: 280ms cubic-bezier(0.22, 1, 0.36, 1);

  --measure: 62ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.021em;
  line-height: 1.04;
  margin: 0;
  /* Guards against descender clipping on tight line-heights. */
  padding-block-end: 0.06em;
}

a { color: var(--c-tomato-deep); }

:where(a, button, input, summary):focus-visible {
  outline: 3px solid var(--c-tomato);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--c-ink); color: var(--c-paper);
  padding: .75rem 1.25rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

/* Gutters are shared by the hero and every section below it, so the headline
   runs to the same edge as the content — never visually narrowed. */
.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3.5rem);
}

/* ---------- header ---------- */

.masthead {
  padding-block: var(--sp-5);
  border-bottom: 1px solid var(--c-rule);
  background: var(--c-paper-warm);
}
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.wordmark {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: .9375rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--c-ink);
  text-decoration: none;
}
.wordmark .dot { color: var(--c-tomato); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  /* 52px tall: comfortable thumb target for a phone held over a counter. */
  padding: .85rem 1.65rem;
  min-height: 52px;
  cursor: pointer;
  transition: background var(--m-quick), color var(--m-quick),
              border-color var(--m-quick), transform var(--m-quick);
}
.btn-primary { background: var(--c-tomato); color: #fff; }
.btn-primary:hover { background: var(--c-tomato-deep); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--c-ink); border-color: var(--c-ink); }
.btn-ghost:hover { background: var(--c-ink); color: var(--c-paper-warm); }
.btn-sm { font-size: .9375rem; padding: .55rem 1.15rem; min-height: 44px; }

/* ---------- hero ---------- */

.hero { background: var(--c-paper-warm); overflow: hidden; }
.hero .wrap {
  display: grid;
  gap: var(--sp-6);
  padding-block: var(--sp-8) 0;
}

.hero h1 {
  font-size: clamp(2.5rem, 8.5vw, 4.25rem);
  max-width: 15ch;
}
.hero h1 .line2 { color: var(--c-tomato); display: block; }

.hero p.lede {
  font-size: clamp(1.125rem, 2.2vw, 1.3125rem);
  color: var(--c-ink-muted);
  max-width: 46ch;
  margin: var(--sp-5) 0 0;
}

.cta-row {
  display: flex; flex-wrap: wrap; gap: .75rem;
  margin-top: var(--sp-6);
}

.reassure {
  font-family: var(--f-numeric);
  font-size: .8125rem;
  color: var(--c-ink-muted);
  margin: 1rem 0 0;
  letter-spacing: -.01em;
}

.hero-art {
  position: relative;
  margin-inline: calc(clamp(1.25rem, 5vw, 3.5rem) * -1);
}
/* Portrait crop would otherwise eat a whole phone screen before the fold. */
.hero-art img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 42%;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--sp-7);
    padding-block: var(--sp-9) var(--sp-8);
  }
  .hero-art { margin-inline: 0; }
  .hero-art img { border-radius: var(--r-lg); aspect-ratio: 3 / 4; }
}

/* ---------- promise band ---------- */

.promise {
  background: var(--c-mint-pale);
  border-block: 1px solid var(--c-mint);
  padding-block: var(--sp-8);
}
.promise .wrap { display: grid; gap: var(--sp-6); }
.promise h2 {
  font-size: clamp(1.75rem, 4.6vw, 2.75rem);
  max-width: 20ch;
}
.promise p {
  max-width: var(--measure);
  color: var(--c-ink-muted);
  margin: var(--sp-5) 0 0;
}
.promise-art { margin: 0; }
.promise-art img { border-radius: var(--r-lg); width: 100%; }
.promise-art figcaption {
  font-family: var(--f-numeric);
  font-size: .8125rem;
  color: var(--c-ink-muted);
  margin-top: .75rem;
  letter-spacing: -.01em;
}

@media (min-width: 900px) {
  /* Copy leads, image follows and carries the right half so the band is not
     a wall of empty mint. */
  .promise .wrap { grid-template-columns: 1fr 1fr; align-items: center; gap: var(--sp-7); }
  .promise p { margin-top: var(--sp-5); }
}

/* ---------- steps ----------
   Not three identical cards. Big tabular numerals set the rhythm and the rows
   are ruled like a list, which is what this content actually is. */

.steps { padding-block: var(--sp-8); }
.steps > .wrap > h2 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  margin-bottom: var(--sp-6);
}

.step {
  display: grid;
  /* Explicit placement: without it the paragraph sizes the `auto` column and
     crushes the heading into a few characters at narrow widths. */
  grid-template-columns: min-content 1fr;
  gap: .5rem var(--sp-5);
  align-items: start;
  padding-block: var(--sp-5);
  border-top: 1px solid var(--c-rule);
}
.step .n { grid-area: 1 / 1 / 3 / 2; }
.step h3 { grid-area: 1 / 2 / 2 / 3; }
.step p  { grid-area: 2 / 2 / 3 / 3; }
.step:last-child { border-bottom: 1px solid var(--c-rule); }

.step .n {
  font-family: var(--f-numeric);
  font-feature-settings: 'tnum' 1;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 500;
  color: var(--c-tomato);
  line-height: 1;
  min-width: 2ch;
}
.step h3 { font-size: clamp(1.1875rem, 2.6vw, 1.5rem); }
.step p { margin: .5rem 0 0; color: var(--c-ink-muted); max-width: 52ch; }

@media (min-width: 760px) {
  .step { grid-template-columns: min-content 22ch 1fr; align-items: baseline; }
  .step .n { grid-area: 1 / 1 / 2 / 2; }
  .step h3 { grid-area: 1 / 2 / 2 / 3; }
  .step p  { grid-area: 1 / 3 / 2 / 4; margin-top: 0; }
}

/* ---------- close ---------- */

.close {
  background: var(--c-ink);
  color: var(--c-paper-warm);
  padding-block: var(--sp-8);
  text-align: center;
}
.close h2 {
  font-size: clamp(1.75rem, 5vw, 3rem);
  max-width: 18ch;
  margin-inline: auto;
}
.close .btn-primary { margin-top: var(--sp-6); }
.close .reassure { color: oklch(78% 0.006 45); }

/* ---------- footer ---------- */

.foot {
  padding-block: var(--sp-6);
  border-top: 1px solid var(--c-rule);
  font-size: .875rem;
  color: var(--c-ink-muted);
}
.foot .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

/* ---------- entrance ----------
   One orchestrated load, staggered. Not scattered micro-interactions. */

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise var(--m-base) both; }
  .rise:nth-child(2) { animation-delay: 60ms; }
  .rise:nth-child(3) { animation-delay: 120ms; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
  }
}

/* Header CTA: full label needs more room than a 390px viewport has beside the
   wordmark. Both labels are real text; only one is rendered at a time. */
.at-sm { display: inline; }
.at-lg { display: none; }
@media (min-width: 560px) {
  .at-sm { display: none; }
  .at-lg { display: inline; }
}

/* ============================================================ auth pages
   Single column, labels above inputs (never placeholder-as-label), 52px+
   targets, errors tied to fields by aria-describedby. §22 requires this to
   work for older adults and for keyboard users. */

.authwrap {
  max-width: 30rem;
  margin-inline: auto;
  padding: var(--sp-7) clamp(1.25rem, 5vw, 2rem) var(--sp-8);
}
.authwrap h1 { font-size: clamp(1.75rem, 6vw, 2.375rem); }
.authwrap > p.sub { color: var(--c-ink-muted); margin: var(--sp-4) 0 var(--sp-6); }

.field { margin-bottom: var(--sp-5); }
.field label {
  display: block;
  font-weight: 600;
  font-size: .9375rem;
  margin-bottom: .4rem;
}
.field input {
  width: 100%;
  font: inherit;
  font-size: 1.0625rem;          /* >=16px or iOS zooms the page on focus */
  padding: .85rem 1rem;
  min-height: 52px;
  color: var(--c-ink);
  background: var(--c-paper-warm);
  border: 2px solid var(--c-rule);
  border-radius: var(--r-md);
  transition: border-color var(--m-quick);
}
.field input:hover { border-color: var(--c-ink-muted); }
.field input:focus { border-color: var(--c-tomato); }
.field .hint {
  font-size: .875rem;
  color: var(--c-ink-muted);
  margin: .4rem 0 0;
}
/* Field errors carry an icon and text, never colour alone (§22). */
.field .err {
  display: none;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--s-missing, oklch(38% 0.09 33));
  margin: .45rem 0 0;
}
.field.bad input { border-color: oklch(38% 0.09 33); }
.field.bad .err { display: block; }
.field .err::before { content: "! "; font-family: var(--f-numeric); }

.formnote {
  display: none;
  padding: .9rem 1.1rem;
  border-radius: var(--r-md);
  margin-bottom: var(--sp-5);
  font-size: .9375rem;
  border: 2px solid;
}
.formnote.show { display: block; }
.formnote.bad  { border-color: oklch(38% 0.09 33); background: oklch(96% 0.02 33); color: oklch(34% 0.09 33); }
.formnote.good { border-color: var(--s-ready); background: var(--c-mint-pale); color: oklch(38% 0.10 155); }

.btn-block { width: 100%; }
.btn[aria-busy="true"] { opacity: .65; pointer-events: none; }

.authfoot {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-rule);
  font-size: .9375rem;
  color: var(--c-ink-muted);
}
.authfoot a { font-weight: 600; }
.authfoot p { margin: .4rem 0; }

/* No-JS: the enhanced-only hint is hidden until JS confirms it can run. */
.js-only { display: none; }

/* ============================================================ my kitchen */

.kwrap { max-width: 52rem; margin-inline: auto; padding: var(--sp-6) clamp(1.25rem,5vw,2rem) var(--sp-8); }

.appnav {
  display: flex; gap: .35rem; flex-wrap: wrap;
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--c-rule);
}
.appnav a {
  font-family: var(--f-display); font-weight: 700; font-size: .9375rem;
  text-decoration: none; color: var(--c-ink-muted);
  padding: .7rem 1rem; min-height: 44px; display: inline-flex; align-items: center;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.appnav a:hover { color: var(--c-ink); }
.appnav a[aria-current="page"] { color: var(--c-ink); border-bottom-color: var(--c-tomato); }

.addbox { margin-bottom: var(--sp-7); }
.addbox textarea {
  width: 100%; font: inherit; font-size: 1.0625rem; line-height: 1.5;
  padding: .9rem 1rem; min-height: 92px; resize: vertical;
  color: var(--c-ink); background: var(--c-paper-warm);
  border: 2px solid var(--c-rule); border-radius: var(--r-md);
}
.addbox textarea:focus { border-color: var(--c-tomato); outline: none; }
.addrow { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .75rem; }
.addrow .grow { flex: 1 1 auto; }

/* Segmented control for which list an entry lands in (D11). */
.seg { display: inline-flex; border: 2px solid var(--c-rule); border-radius: var(--r-pill); overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  font-family: var(--f-display); font-weight: 700; font-size: .875rem;
  padding: .55rem 1rem; min-height: 44px; display: inline-flex; align-items: center;
  cursor: pointer; color: var(--c-ink-muted);
}
.seg input:checked + label { background: var(--c-ink); color: var(--c-paper-warm); }
.seg input:focus-visible + label { outline: 3px solid var(--c-tomato); outline-offset: -3px; }

.klist { margin-bottom: var(--sp-7); }
.klist h2 { font-size: clamp(1.25rem,3.4vw,1.625rem); }
.klist .lede { color: var(--c-ink-muted); font-size: .9375rem; margin: .4rem 0 var(--sp-5); max-width: 56ch; }
.kcount { font-family: var(--f-numeric); font-size: .8125rem; color: var(--c-ink-muted); }

/* Ruled rows, not cards. This is a list; cards would be the lazy answer. */
.kitems { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-rule); }
/* Two rows on a phone: the name gets the full width instead of wrapping to
   three lines beside two buttons; actions sit underneath, right-aligned.
   Collapses to a single row as soon as there is room. */
.kitem {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name qty" "acts acts";
  align-items: baseline;
  gap: .15rem .6rem;
  padding: .7rem .25rem .5rem;
  border-bottom: 1px solid var(--c-rule);
}
.kitem .name { grid-area: name; font-weight: 600; }
.kitem .qty {
  grid-area: qty;
  font-family: var(--f-numeric); font-size: .8125rem; color: var(--c-ink-muted);
  font-feature-settings: 'tnum' 1; white-space: nowrap;
}
.kitem .spacer { display: none; }
.kitem .acts { grid-area: acts; display: flex; justify-content: flex-end; gap: .2rem; }

@media (min-width: 560px) {
  .kitem {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas: "name qty . acts";
    gap: .6rem;
    padding: .6rem .25rem;
  }
}
.kitem .act {
  background: none; border: 0; font: inherit; font-size: .8125rem; font-weight: 600;
  color: var(--c-ink-muted); cursor: pointer; padding: .45rem .5rem; min-height: 44px;
  border-radius: var(--r-sm, 4px);
}
.kitem .act:hover { color: var(--c-tomato-deep); background: var(--c-mint-pale); }
.kempty { color: var(--c-ink-muted); padding: var(--sp-5) .25rem; border-bottom: 1px solid var(--c-rule); }

/* Staples checklist — tap-to-toggle chips, not a wall of checkboxes. */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: var(--sp-4) 0 var(--sp-5); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip label {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem .95rem; min-height: 44px; cursor: pointer;
  font-size: .9375rem; font-weight: 600;
  border: 2px solid var(--c-rule); border-radius: var(--r-pill);
  background: var(--c-paper-warm); color: var(--c-ink-muted);
  transition: border-color var(--m-quick), color var(--m-quick), background var(--m-quick);
}
.chip label::before { content: "+"; font-family: var(--f-numeric); }
.chip input:checked + label {
  border-color: var(--s-ready); color: oklch(38% .10 155); background: var(--c-mint-pale);
}
.chip input:checked + label::before { content: "✓"; }
.chip input:focus-visible + label { outline: 3px solid var(--c-tomato); outline-offset: 2px; }

.chipgroup h3 {
  font-size: .8125rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--c-ink-muted); font-family: var(--f-body); font-weight: 600;
  margin-top: var(--sp-5);
}

/* ============================================================ find a meal */

.opts { display: grid; gap: var(--sp-5); margin-bottom: var(--sp-6); }
.opt > .lbl {
  display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .5rem;
}
.pills { display: flex; flex-wrap: wrap; gap: .45rem; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill label {
  display: inline-flex; align-items: center; padding: .5rem .95rem; min-height: 44px;
  cursor: pointer; font-size: .9375rem; font-weight: 600;
  border: 2px solid var(--c-rule); border-radius: var(--r-pill);
  background: var(--c-paper-warm); color: var(--c-ink-muted);
  transition: border-color var(--m-quick), color var(--m-quick), background var(--m-quick);
}
.pill input:checked + label { border-color: var(--c-ink); background: var(--c-ink); color: var(--c-paper-warm); }
.pill input:focus-visible + label { outline: 3px solid var(--c-tomato); outline-offset: 2px; }

.scopeline {
  font-size: .9375rem; color: var(--c-ink-muted);
  padding: .85rem 1rem; border: 1px solid var(--c-rule); border-radius: var(--r-md);
  background: var(--c-paper-warm); margin-bottom: var(--sp-5);
}
.scopeline strong { color: var(--c-ink); }
.scopeline button {
  background: none; border: 0; font: inherit; font-size: .875rem; font-weight: 600;
  color: var(--c-tomato-deep); cursor: pointer; padding: .3rem 0; text-decoration: underline;
}

/* Progress: shows the pipeline working instead of a spinner. */
.prog { display: none; margin: var(--sp-6) 0; }
.prog.show { display: block; }
.prog ol { list-style: none; margin: 0; padding: 0; }
.prog li {
  display: flex; align-items: baseline; gap: .7rem;
  padding: .5rem 0; color: var(--c-ink-muted); font-size: .9375rem;
}
.prog li .mark { font-family: var(--f-numeric); font-size: .8125rem; min-width: 1.5rem; }
.prog li.done { color: var(--c-ink); }
.prog li.done .mark { color: var(--s-ready); }
.prog li.active { color: var(--c-ink); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .prog li.active .mark { animation: pulse 1.1s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .35; } }
}

/* Result cards. §12: the three states must be visually obvious — and §22 says
   never by colour alone, so each carries a mark and a word too. */
.cards { display: grid; gap: var(--sp-5); }
.card {
  border: 1px solid var(--c-rule); border-radius: var(--r-lg);
  background: var(--c-paper-warm); padding: var(--sp-5);
}
.card.ready { border-color: var(--s-ready); border-width: 2px; }
.card h3 { font-size: clamp(1.125rem, 3vw, 1.375rem); margin-bottom: .5rem; }

.state {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8125rem; font-weight: 700; letter-spacing: .02em;
  padding: .3rem .7rem; border-radius: var(--r-pill); margin-bottom: .65rem;
  border: 2px solid;
}
.state .mk { font-family: var(--f-numeric); }
.state.ready      { color: oklch(38% .10 155); border-color: var(--s-ready);      background: var(--c-mint-pale); }
.state.substitute { color: oklch(40% .11 70);  border-color: var(--s-substitute); background: oklch(97% .02 70); }
.state.missing    { color: oklch(36% .09 33);  border-color: oklch(52% .09 33);   background: oklch(97% .015 33); }

.meta {
  font-family: var(--f-numeric); font-size: .8125rem; color: var(--c-ink-muted);
  font-feature-settings: 'tnum' 1; margin-bottom: .6rem;
}
.card .why { margin: 0 0 var(--sp-4); }
.card .ings { font-size: .9375rem; color: var(--c-ink-muted); margin: 0 0 var(--sp-4); }
.card .ings b { color: var(--c-ink); font-weight: 600; }
.card .ings .sub { color: oklch(40% .11 70); font-weight: 600; }
.card .ings .miss { color: oklch(36% .09 33); font-weight: 600; }
.card .src { font-size: .8125rem; color: var(--c-ink-muted); margin: var(--sp-4) 0 0; }

/* ---------- recipe detail / cooking mode ---------- */

.rmeta { font-family: var(--f-numeric); font-size: .875rem; color: var(--c-ink-muted); margin: .5rem 0 var(--sp-5); }
.ilist { list-style: none; padding: 0; margin: 0 0 var(--sp-6); border-top: 1px solid var(--c-rule); }
.ilist li {
  display: flex; align-items: baseline; gap: .6rem;
  padding: .55rem .2rem; border-bottom: 1px solid var(--c-rule); font-size: 1rem;
}
.ilist .mk { font-family: var(--f-numeric); font-size: .8125rem; min-width: 1.4rem; }
.ilist .available .mk { color: var(--s-ready); }
.ilist .substitutable { color: oklch(40% .11 70); }
.ilist .missing { color: oklch(36% .09 33); }
.ilist .optional { color: var(--c-ink-muted); }

/* Cooking mode (§14): large type, big targets, one step at a time. */
.cook { display: none; }
.cook.show { display: block; }
.cook .stepno { font-family: var(--f-numeric); color: var(--c-tomato); font-size: 1rem; margin-bottom: .6rem; }
.cook .steptext { font-size: clamp(1.375rem, 4.5vw, 1.875rem); line-height: 1.35; font-weight: 600; margin: 0 0 var(--sp-6); }
.cook .navrow { display: flex; gap: .6rem; }
.cook .navrow .btn { flex: 1 1 auto; min-height: 60px; font-size: 1.125rem; }

/* ---------- staples pass: presets + progressive disclosure ---------- */

.presets { display: flex; flex-wrap: wrap; gap: .5rem; margin: var(--sp-4) 0 var(--sp-6); }
.preset {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  padding: .7rem 1rem; min-height: 56px; cursor: pointer; text-align: left;
  border: 2px solid var(--c-rule); border-radius: var(--r-md);
  background: var(--c-paper-warm); font: inherit; color: var(--c-ink);
  transition: border-color var(--m-quick), background var(--m-quick);
}
.preset:hover { border-color: var(--c-ink-muted); }
.preset[aria-pressed="true"] { border-color: var(--c-tomato); background: oklch(97% .02 33); }
.preset .p-label { font-family: var(--f-display); font-weight: 700; font-size: .9375rem; }
.preset .p-hint { font-size: .8125rem; color: var(--c-ink-muted); }

.cathead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .75rem; margin-top: var(--sp-5);
}
.cathead h3 { margin: 0; }
.catall {
  background: none; border: 0; font: inherit; font-size: .8125rem; font-weight: 600;
  color: var(--c-tomato-deep); cursor: pointer; padding: .4rem 0; min-height: 44px;
  text-decoration: underline; white-space: nowrap;
}
.morebtn {
  background: none; border: 2px dashed var(--c-rule); border-radius: var(--r-pill);
  font: inherit; font-size: .875rem; font-weight: 600; color: var(--c-ink-muted);
  padding: .5rem 1rem; min-height: 44px; cursor: pointer;
}
.morebtn:hover { border-color: var(--c-ink-muted); color: var(--c-ink); }
.chips.more { display: none; }
.chips.more.open { display: flex; }

.selcount {
  position: sticky; bottom: 0; z-index: 5;
  background: var(--c-paper-warm);
  border-top: 1px solid var(--c-rule);
  /* Slim: it overlays content at the top of the page, so every extra pixel is
     a pixel of the list the reader cannot see. */
  padding: .6rem 0;
  margin-top: var(--sp-5);
  display: flex; align-items: center; gap: .75rem;
  box-shadow: 0 -8px 16px -12px oklch(26.8% 0.006 34.3 / .35);
}
.selcount .n { font-family: var(--f-numeric); font-weight: 500; font-size: .875rem; }
.selcount .btn { min-height: 46px; padding-block: .6rem; }
/* Clearance so the sticky bar can never permanently hide the end of the list. */
#staples-intro { padding-bottom: 4.5rem; }

/* ---------- my kitchen: browse the catalogue ---------- */

.addmodes { display: flex; gap: .35rem; margin-bottom: var(--sp-4); }
.addmodes button {
  font-family: var(--f-display); font-weight: 700; font-size: .9375rem;
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: .6rem .2rem; margin-right: .8rem; min-height: 44px;
  color: var(--c-ink-muted); cursor: pointer;
}
.addmodes button[aria-selected="true"] { color: var(--c-ink); border-bottom-color: var(--c-tomato); }

.searchrow { position: relative; margin-bottom: var(--sp-4); }
.searchrow input {
  width: 100%; font: inherit; font-size: 1.0625rem;
  padding: .85rem 1rem; min-height: 52px;
  color: var(--c-ink); background: var(--c-paper-warm);
  border: 2px solid var(--c-rule); border-radius: var(--r-md);
}
.searchrow input:focus { border-color: var(--c-tomato); outline: none; }

.catbar { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: var(--sp-4); }
.catbar button {
  font: inherit; font-size: .875rem; font-weight: 600;
  padding: .45rem .85rem; min-height: 44px; cursor: pointer;
  border: 2px solid var(--c-rule); border-radius: var(--r-pill);
  background: var(--c-paper-warm); color: var(--c-ink-muted);
}
.catbar button[aria-pressed="true"] { background: var(--c-ink); color: var(--c-paper-warm); border-color: var(--c-ink); }

/* Catalogue results: tap to add, immediately. */
.catalog { display: flex; flex-wrap: wrap; gap: .45rem; min-height: 3rem; }
.catadd {
  font: inherit; font-size: .9375rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .95rem; min-height: 44px; cursor: pointer;
  border: 2px solid var(--c-rule); border-radius: var(--r-pill);
  background: var(--c-paper-warm); color: var(--c-ink);
  transition: border-color var(--m-quick), background var(--m-quick), color var(--m-quick);
}
.catadd::before { content: "+"; font-family: var(--f-numeric); color: var(--c-tomato); }
.catadd:hover { border-color: var(--c-tomato); }
.catadd[data-has="1"] {
  border-color: var(--s-ready); background: var(--c-mint-pale);
  color: oklch(38% .10 155); cursor: default;
}
.catadd[data-has="1"]::before { content: "✓"; color: var(--s-ready); }
.catempty { color: var(--c-ink-muted); font-size: .9375rem; padding: .8rem 0; }
