/* ============================================================
   COOKBOOK — Base + Components + Page layouts
   Built on tokens.css. Mirrors the Figma design, made responsive.
   ============================================================ */

@import url("tokens.css");

@font-face { font-family: "Comic Sans MS"; src: url("../fonts/Comic_Sans_MS.ttf") format("truetype"); font-weight: normal; font-style: normal; font-display: swap; }

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-page);
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ---- Pill button (white, black outline, italic underlined) ---- */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  padding: 0 34px;
  background: var(--color-bg);
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-button);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.btn-pill:hover { background: var(--color-ink); color: var(--color-bg); }

/* ---- Inline text link (italic underlined, with ✸) ---- */
.link-star {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-button);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---- Search bar "Filter your feelings" ---- */
.search {
  display: flex;
  align-items: center;
  width: min(331px, 100%);
  min-height: var(--control-h);
  padding: 0 25px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-input);
  background: var(--color-bg);
}
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-search);
  color: var(--color-ink);
  background: transparent;
}
.search input::placeholder { color: var(--color-muted); }

/* ---- Tag chip (detail screen) ---- */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  background: var(--color-chip);
  border-radius: var(--radius-chip);
  font-family: var(--font-tag);
  font-size: var(--fs-tag-md);
}

/* ---- Divider rule ---- */
.rule {
  border: 0;
  border-top: 1px solid var(--color-rule);
  margin: 0;
}

/* ============================================================
   HOME / LIBRARY
   ============================================================ */
/* Home column order: COOKBOOK → grid (filter bars are full-bleed, outside .page) */
.home {
  display: flex;
  flex-direction: column;
  /* clear the fixed filter bar above and the fixed bottom-nav below */
  padding-top: calc(var(--control-h) + 1px);   /* clears the fixed filter bar's own border */
  padding-bottom: 193px;   /* 128px visible gap + 65px fixed bottom-nav height */
}
.home .cookbook-title { margin: 88px 0 88px; }

.cookbook-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: 1;
  margin: 0 0 var(--space-4);
  letter-spacing: -0.01em;
}

/* Fixed bottom bar: Shopping list + Add recipe */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  border-top: 1px solid var(--color-ink);
  background: var(--color-bg);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-button);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bottom-nav a:first-child { border-right: 1px solid var(--color-ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--gap-grid-x);
  row-gap: var(--gap-grid-y);
}

.card { text-decoration: none; display: block; }
.card-block {
  height: var(--card-block-h);
  width: 100%;
  border: 2px solid transparent;
}
.card:hover .card-block { border-color: var(--color-ink); }
.card-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-card-title);
  margin: var(--space-2) 0 0;
}
.card-tags {
  font-family: var(--font-tag);
  font-size: var(--fs-tag-sm);
  margin: 2px 0 0;
}
.card.hidden { display: none; }

/* ---- Filter your feelings — full-bleed bordered bars, fixed to the top ---- */
.filter-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--color-bg);
}
.filter-bar {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-bottom: 1px solid var(--color-ink);
}
.filter-bar-input {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 var(--space-page);
  min-height: var(--control-h);
  background: var(--color-bg);
  cursor: text;
}
.filter-bar-input input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-display);
  font-size: var(--fs-search);
  color: var(--color-ink);
}
.filter-bar-input input::placeholder { color: var(--color-muted); }

.filter-pool-bar {
  display: none;
  flex-wrap: wrap;
  width: 100%;
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-ink);
}
.filter-pool-bar.open { display: flex; }
.feel-bar {
  border: 0;
  border-right: 1px solid var(--color-ink);
  background: transparent;
  color: var(--color-ink);
  font-family: var(--font-tag);
  font-size: 13px;
  padding: 0 18px;
  min-height: 40px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease;
}
.feel-bar[aria-pressed="true"] { background: var(--accent-pink); }
.feel-bar[hidden] { display: none; }
.empty {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--color-muted);
  margin: 0;
}
.end-of-book {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  margin: 384px 0 0;
}

/* ============================================================
   RECIPE DETAIL
   ============================================================ */
/* Full-bleed color band — spans the entire viewport at any resolution */
.hero { width: 100%; }
/* Inner content aligns to the same centered column as .page */
.hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 52px var(--space-page) 35px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: var(--hero-h);
}
.hero-inner .link-star { align-self: flex-start; }
.hero-inner .btn-pill { align-self: flex-start; margin-top: 142px; }

.recipe-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: 1;
  /* bottom gap matches the color-block → title gap (page padding + top margin) */
  margin: var(--space-4) 0 90px;
}

/* Ingredients + directions live in one bordered box, divider-separated rows */
.recipe-box {
  border: 1px solid var(--color-ink);
  padding: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}
.recipe-box .col-ingredients {
  flex: 0 0 340px;
  min-width: 260px;
  border-right: 1px solid var(--color-ink);
  padding-right: 48px;
}
.recipe-box .col-steps { flex: 1; min-width: 300px; }

.section-label { margin: 0 0 24px; font-size: 18px; }

.row-list { list-style: none; margin: 0; padding: 0; }
.row-list li {
  padding: 11px 0;
  border-bottom: 1px solid var(--color-line);
  font-size: 16px;
  line-height: 1.4;
}
.row-list .ing-item::before { content: "• "; }

/* Reused by the shopping list's aggregated ingredients card */
.ingredients-card {
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-input);
  padding: 24px;
}

/* Full-width rule between the recipe body and the tags/edit footer */
.recipe-rule {
  border: 0;
  border-top: 1px solid var(--color-rule);
  margin: 48px 0 0;
}

/* Cursor-follow tooltip on Cook mode hover */
.yummy-tip {
  display: none;
  position: fixed;
  pointer-events: none;
  z-index: 100;
  border: 1px solid var(--color-ink);
  padding: 4px 12px;
  font-family: var(--font-tag);
  font-size: 14px;
  color: var(--color-ink);
}
.yummy-tip.show { display: block; }

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 38px 0 46px;
}

/* ============================================================
   RESPONSIVE — laptop adds/edits, phone cooks
   ============================================================ */
@media (max-width: 720px) {
  .page { padding: 24px; }
  .home .cookbook-title { margin: 32px 0 40px; }
  .filter-bar-input { padding: 0 24px; }
  .grid { grid-template-columns: 1fr; }
  .hero-inner {
    padding: 32px 24px 24px;
    min-height: 220px;
  }
  .hero-inner .btn-pill { margin-top: 64px; }
  .recipe-box { flex-direction: column; gap: var(--space-4); padding: 24px; }
  .recipe-box .col-ingredients { border-right: 0; padding-right: 0; flex-basis: auto; min-width: 0; }
}

/* ============================================================
   TOP BAR (New Food + Cook mode share this)
   ============================================================ */
.topbar {
  position: sticky;   /* stays pinned while the form scrolls */
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 109px;
  padding: 0 48px;
  background: var(--color-bg);   /* opaque so content scrolls under it */
  border-bottom: 1px solid var(--color-ink);
  gap: var(--space-3);
  transition: background 160ms ease;
}
/* When a recipe color is chosen, the bar tints to it */
.topbar[data-tinted="true"] { border-bottom: 0; }

.topbar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  white-space: nowrap;
  text-transform: uppercase;   /* "pad thai" → "PAD THAI" */
  text-align: center;
  pointer-events: none;
}

/* Save pill: white, black border, fully rounded, right-aligned */
.btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 28px;
  background: var(--color-bg);
  border: 1px solid var(--color-ink);
  border-radius: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-button);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.btn-save:hover { background: var(--color-ink); color: var(--color-bg); }

/* ============================================================
   NEW FOOD form
   ============================================================ */
.form {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 48px 80px;
  display: grid;
  grid-template-columns: 160px 567px;
  column-gap: 60px;
  row-gap: 32px;
  align-items: start;
}
.form-label {
  font-family: var(--font-display);
  font-size: 20px;
  padding-top: 6px;
}
.field {
  width: 100%;
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-input);
  padding: 20px 24px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-ink);
  background: var(--color-bg);
  resize: none;
  outline: none;
}
.field:focus { box-shadow: 0 0 0 2px var(--color-ink) inset; }
.field::placeholder { color: var(--color-muted); }
.field-name { height: auto; }
.field-ingredients { height: 220px; }
.field-steps { height: 220px; }

/* COLOR swatch picker */
.color-picker {
  display: grid;
  grid-template-columns: repeat(8, 32px);
  gap: 10px;
}
.swatch {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-ink);
  cursor: pointer;
  padding: 0;
  border-radius: 2px;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--color-ink); }

/* Delete recipe link (edit mode only) — coral to signal it's destructive */
.form-delete {
  grid-column: 1 / -1;
  margin-top: 8px;
}
.link-danger {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-button);
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--accent-coral);
  cursor: pointer;
}
.link-danger[hidden] { display: none; }

/* ---- Tags chip input ---- */
.tags-input {
  position: relative;
  min-height: 100px;
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-input);
  padding: 16px;
  background: var(--color-bg);
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  cursor: text;
}
.tags-input:focus-within { box-shadow: 0 0 0 2px var(--color-ink) inset; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 6px 0 12px;
  background: var(--color-chip);
  border-radius: var(--radius-chip);
  font-family: var(--font-tag);
  font-size: 14px;
}
.tag-chip button {
  border: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  color: var(--color-ink);
}
.tags-input .tag-entry {
  flex: 1;
  min-width: 120px;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-ink);
}
.tag-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 10;
  min-width: 220px;
  background: var(--color-bg);
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-input);
  padding: 6px;
  display: none;
  max-height: 220px;
  overflow-y: auto;
}
.tag-suggestions.open { display: block; }
.tag-suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  font-family: var(--font-tag);
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
}
.tag-suggestions button:hover,
.tag-suggestions button[aria-selected="true"] { background: var(--color-chip); }

/* ============================================================
   COOK MODE
   ============================================================ */
.cook {
  position: relative;   /* positioning context for the bookmark rail */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;      /* keep the bookmark's overhang from adding scroll */
  /* Set per recipe; the header uses this at 30% opacity. Defaults to pink. */
  --recipe-color: var(--accent-pink);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 420ms ease 120ms, transform 420ms ease 120ms;
}
.cook.started { opacity: 1; transform: translateY(0); }
.cook-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 109px;
  padding: 0 82px 0 48px;
  background: var(--recipe-color);
}
.cook-title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  white-space: nowrap;
  pointer-events: none;
}
.cook-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cook-toggle {
  border: 1px solid var(--color-ink);
  background: var(--recipe-color, var(--accent-pink));
  border-radius: 100px;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease;
}
.cook-toggle[aria-pressed="true"] { background: var(--color-bg); }
.cook-exit {
  font-family: var(--font-display);
  font-size: 34px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* ✸ close on the start screen, top-right corner */
.cook-intro-close {
  position: absolute;
  top: 44px;
  right: 48px;
  font-family: var(--font-display);
  font-size: 34px;
  text-decoration: underline;
  text-underline-offset: 2px;
  line-height: 1;
}

/* ---- Cook-mode start screen (pick voice / hands, grant permission once) ---- */
.cook-intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--color-canvas);
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: 48px;
  overflow-y: auto;
  opacity: 1;
  transform: scale(1);
  transition: opacity 300ms ease, transform 300ms ease;
}
.cook-intro[hidden] { display: none; }
.cook-intro.leaving { opacity: 0; transform: scale(0.97); pointer-events: none; }
.cook-intro-inner {
  max-width: min(90vw, 900px);
  width: 100%;
  text-align: center;
}
.cook-intro-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 8vw, 88px);
  line-height: 1;
  margin: 0 0 16px;
}

.cook-intro-hint {
  font-family: var(--font-tag);
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  margin: 72px 0 0;
}
.cook-intro-post {
  opacity: 1;
  transition: opacity 250ms ease;
}
.cook-intro-post.hidden-post { opacity: 0; pointer-events: none; }

.cook-circles {
  display: flex;
  gap: 28px;
  justify-content: center;
  margin: 16px 0 72px;
}
.cook-circle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 160px;
}
.cook-circle-caption {
  font-family: var(--font-tag);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  margin: 0;
}
.cook-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid var(--color-ink);
  background: var(--color-canvas);
  color: var(--color-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, transform 120ms ease;
}
.cook-circle:hover { transform: translateY(-2px); }
.cook-circle[aria-pressed="true"] { background: var(--color-bg); }
.cook-intro-note {
  min-height: 18px;
  margin: 18px 0 0;
  font-family: var(--font-tag);
  font-size: 13px;
  color: var(--color-muted);
}

/* Small live camera preview (mirrored) shown when hand gestures are on */
.cook-cam {
  position: fixed;
  left: 24px;
  bottom: 120px;
  width: 160px;
  height: 120px;
  border: 1px solid var(--color-ink);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  display: none;
  z-index: 60;
}
.cook-cam.on { display: block; }
.cook-cam video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);   /* mirror, so it reads like a mirror */
}

/* Ephemeral "heard: next" / "saw: ✋" indicator */
.input-hint {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  background: var(--color-ink);
  color: var(--color-bg);
  font-family: var(--font-tag);
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 100px;
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
  z-index: 70;
}
.input-hint.show { opacity: 1; }

.cook-body {
  flex: 1;
  padding: 48px 48px 120px;
}

/* Ingredients rail + step text live side by side in one bordered box */
.cook-card {
  border: 1px solid var(--color-ink);
  padding: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}
.cook-rail {
  flex: 0 0 260px;
  min-width: 220px;
  border-right: 1px solid var(--color-ink);
  padding-right: 40px;
}
.cook-main { flex: 1; min-width: 260px; }
.cook-rail-label {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 20px;
}
.cook-rail ul { list-style: none; margin: 0; padding: 0; }
.cook-rail li {
  font-size: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-line);
}
.cook-rail li:last-child { border-bottom: none; }
.cook-step-num {
  font-family: var(--font-display);
  color: var(--color-ink);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin: 0 0 16px;
}
.cook-step-text {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.cook-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  border-top: 1px solid var(--color-ink);
  background: var(--color-bg);
}
.cook-nav button {
  flex: 1;
  background: var(--color-bg);
  border: 0;
  min-height: 64px;
  padding: 0 40px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.cook-nav button:first-child { text-align: left; border-right: 1px solid var(--color-ink); }
.cook-nav button:last-child { text-align: right; }
.cook-nav button:hover:not(:disabled) { background: var(--color-ink); color: var(--color-bg); }
.cook-nav button:disabled { opacity: 0.3; cursor: default; }

/* ---- Recipe-finished screen ---- */
.cook-end {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--color-canvas);
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
}
.cook-end.show { display: flex; }
.cook-end-inner { max-width: 1014px; width: 100%; padding: 0 56px; }
.cook-end-line1, .cook-end-good {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 8.1vw, 103.83px);
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}
.cook-end-good { opacity: 0; transition: opacity 400ms ease; }
.cook-end-good.reveal { opacity: 1; }
.cook-end-sub {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(15px, 1.55vw, 29.81px);
  color: var(--color-ink);
  margin: 24px 0 0;
  opacity: 0;
  transition: opacity 400ms ease;
}
.cook-end-sub.reveal { opacity: 1; }
.cook-end-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(100%);
  transition: transform 500ms cubic-bezier(.2,.7,.3,1);
}
.cook-end-bar.reveal { transform: translateY(0); }

/* ============================================================
   SHOPPING LIST
   ============================================================ */
.recipe-picker { border: 1px solid var(--color-ink); }
.recipe-picker-bar {
  display: flex;
  align-items: center;
  padding: 0 24px;
  min-height: 56px;
  background: var(--color-bg);
  cursor: text;
}
.recipe-picker-bar input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-display);
  font-size: var(--fs-search);
  color: var(--color-ink);
}
.recipe-picker-bar input::placeholder { color: var(--color-muted); }
.recipe-picker-list { display: none; border-top: 1px solid var(--color-ink); }
.recipe-picker-list.open { display: block; }
.recipe-picker-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-line);
  transition: background 120ms ease;
}
.recipe-picker-row:last-child { border-bottom: none; }
.recipe-picker-row.on { background: var(--row-tint, transparent); }
.recipe-picker-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--color-ink); flex: none; }
.recipe-picker-swatch { width: 28px; height: 28px; flex: none; border: 1px solid var(--color-ink); }
.recipe-picker-name { font-family: var(--font-display); font-size: 18px; }

.shopping-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 620px;
  margin: 0 auto;
}
.shopping-list-head .actions { display: flex; gap: 12px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--color-ink);
  border-radius: 100px;
  background: var(--color-bg);
  color: var(--color-ink);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.icon-btn:hover { background: var(--color-ink); color: var(--color-bg); }
.shopping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-line);
}
.shopping-item:last-child { border-bottom: none; }
.shopping-item label { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.shopping-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--color-ink); flex: none; }
.shopping-item.checked .item-text { text-decoration: line-through; color: var(--color-muted); }
.shopping-item .item-from { white-space: nowrap; flex: none; }

/* Tablet portrait (iPad mini/standard, ~768-820px): the form's fixed
   160px/567px columns don't fit — make the field column fluid instead of
   dropping all the way to the single-column phone layout. */
@media (min-width: 721px) and (max-width: 900px) {
  .form {
    grid-template-columns: 140px 1fr;
    column-gap: 32px;
  }
}

@media (max-width: 720px) {
  .form {
    grid-template-columns: 1fr;
    row-gap: 8px;
    padding: 24px;
  }
  .form-label { padding-top: 16px; }
  .field-ingredients, .field-steps { height: 180px; }
  .topbar, .cook-topbar { padding-left: 20px; padding-right: 20px; }
  .topbar-title, .cook-title { font-size: 22px; }
  .cook-body { padding: 24px 24px 120px; }
  .cook-card { padding: 24px; gap: 24px; }
  .cook-rail { flex-basis: auto; min-width: 0; border-right: 0; padding-right: 0; }
  .cook-step-text { font-size: 26px; }
}
