/* Kitchen page — visual identity band + board layout.
 *
 * Uses the same outer-band → inner-well pattern as community and focus pages.
 * Band color: var(--band-kitchen) — sky #38bdf8 (hue ≈ 200)
 */

/* ── Outer band ── */
.kitchen-band {
  border-radius: 1rem;
  padding: 1.375rem 2rem 1.5rem;
  background: var(--cream-soft);
  box-shadow:
    0 2px 8px -2px oklch(70% 0.10 72 / 0.28),
    0 8px 28px -6px oklch(0 0 0 / 0.08),
    0 0 0 1px oklch(0 0 0 / 0.03);
}

.kitchen-band-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.125rem;
  flex-wrap: wrap;
  min-width: 0;
}

.kitchen-band-header__title {
  color: oklch(var(--bc));
  font-size: clamp(1.25rem, 4.5vw, 1.625rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin: 0;
}

.kitchen-dosha-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.8125rem;
  background: oklch(97% 0.03 72 / 0.85);
  border: 1px solid oklch(65% 0.10 72 / 0.25);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: oklch(28% 0.06 72);
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

/* ── Inner well ── */
.kitchen-inner {
  background: var(--cream-soft);
  border-radius: 0.875rem;
  padding: 1rem;
  /* border: 1px solid oklch(0.62 0.13 200 / 0.20); */
  /* box-shadow: */
  /*   0 1px 3px oklch(0 0 0 / 0.05), */
    /* inset 0 1px 2px oklch(0 0 0 / 0.03); */
}

/* ────────────────────────────────────────────
   Board layout
   ──────────────────────────────────────────── */

.kitchen-board {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  min-height: 60vh;
}

/* Suppress all transitions during init to prevent flash */
.kitchen-board.no-transitions,
.kitchen-board.no-transitions *,
.kitchen-board.no-transitions *::before,
.kitchen-board.no-transitions *::after {
  transition: none !important;
}

/* ── Column color variants (fizzy pattern: --card-color drives all accents) ── */
/* Vibrant, lively, Fizzy-style — each tab pops and feels energetic            */
.kitchen-col--my-foods  { --card-color: oklch(62% 0.22 145); } /* vivid emerald    */
.kitchen-col--groceries { --card-color: oklch(68% 0.22 130); } /* bright lime      */
.kitchen-col--pantry    { --card-color: oklch(72% 0.19  65); } /* hot amber        */
.kitchen-col--cooking   { --card-color: oklch(65% 0.20  30); } /* warm coral       */

/* ── Each column ── */
.kitchen-col {
  display: flex;
  flex-direction: column;
  border-radius: 1.25rem;
  background: transparent;
  border: none;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  transition:
    flex-grow 300ms cubic-bezier(0.25, 1.25, 0.5, 1),
    flex-shrink 300ms cubic-bezier(0.25, 1.25, 0.5, 1),
    min-width 300ms cubic-bezier(0.25, 1.25, 0.5, 1);
}

.kitchen-col::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--card-color);
  border-radius: 9999px;
  opacity: 0;
  transition: opacity 90ms ease;
}

/* Guitar string — thin colored line below the pill, behind everything */
.kitchen-col::after {
  content: '';
  position: absolute;
  top: 38vh;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: linear-gradient(to bottom, var(--card-color), transparent);
  border-radius: 1px;
  opacity: 0;
  pointer-events: none;
  z-index: -2;
  transition: opacity 90ms ease;
}

.kitchen-col.is-collapsed {
  flex: 0 0 2.5rem;
  cursor: pointer;
  border-radius: 9999px;
}

.kitchen-col.is-collapsed::before {
  opacity: 0; /* header::after handles the pill — disable ::before */
}

.kitchen-col.is-collapsed::after {
  opacity: 0.45;
  transition: opacity 80ms ease 240ms;
}

.kitchen-col.is-expanded {
  flex: 1 1 0;
  min-width: 260px;
}

/* ── Column header ── */
.kitchen-col__header {
  padding: 0.875rem 0.875rem 0.75rem;
  flex-shrink: 0;
  background: transparent;
  /* no border-bottom, no tinted bg when expanded */
  transition: background 200ms ease;
  position: relative;  /* anchor for ::after title wave */
  overflow: hidden;    /* contain the wave within the header bounds */
}

.kitchen-col.is-collapsed .kitchen-col__header {
  padding: 0;
  border-bottom: none;
  flex: 1;
  background: transparent;
}

/* Fizzy-style title wave: tall colored bar shrinks upward + spreads outward on expand */
.kitchen-col__header::after {
  /* solid through 82%, then short fade so rounded bottom dissolves gently */
  background: linear-gradient(to bottom, var(--card-color) 0%, var(--card-color) 82%, transparent 100%);
  border-radius: 99rem;
  content: '';
  height: 2.5rem;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  transition:
    width 340ms ease-out,
    height 340ms ease-out,
    opacity 320ms ease-out;
  width: 100%;
  z-index: -1;
}

.kitchen-col.is-collapsed .kitchen-col__header::after {
  height: 38vh; /* pill height — taller, rounded bottom visible, string starts below */
  opacity: 1;
  width: 2.5rem;
}

/* ── Expander button ── */
.kitchen-col__expander {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 100%;
  text-align: left;
  color: inherit;
}

.kitchen-col.is-collapsed .kitchen-col__expander {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  height: 100%;
  padding: 1rem 0;
}

/* Active: icon, then title, then num */
.kitchen-col.is-expanded .kitchen-col__icon { order: 1; }
.kitchen-col.is-expanded .kitchen-col__title { order: 2; }
.kitchen-col.is-expanded .kitchen-col__count { order: 3; }

/* Inactive: num, then icon below, then title */
.kitchen-col.is-collapsed .kitchen-col__count { order: 1; }
.kitchen-col.is-collapsed .kitchen-col__icon { order: 2; }
.kitchen-col.is-collapsed .kitchen-col__title { order: 3; }

/* ── Count badge ── */
.kitchen-col__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kitchen-col__icon-svg {
  width: 1.25rem;
  height: 1.25rem;
  color: oklch(var(--bc) / 0.6);
  fill: currentColor;
}

.kitchen-col--my-foods.is-collapsed .kitchen-col__icon-svg {
  color: #fff;
  fill: currentColor;
}

.kitchen-col--pantry.is-collapsed .kitchen-col__icon-svg {
  color: #fff;
  fill: currentColor;
}

.kitchen-col--groceries.is-collapsed .kitchen-col__icon-svg {
  color: #fff;
  fill: currentColor;
}

.kitchen-col--cooking.is-collapsed .kitchen-col__icon-svg {
  color: #fff;
  fill: currentColor;
}

.kitchen-col--cooking .kitchen-col__icon-svg {
  width: 1.6rem;
  height: 1.6rem;
}

.kitchen-col__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.625rem;
  height: 1.625rem;
  padding: 0 0.3rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--card-color) 18%, oklch(var(--b1)));
  color: var(--card-color);
  font-size: 0.6875rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 200ms ease, color 200ms ease;
}

/* Collapsed badge: white/translucent on vivid bg */
.kitchen-col.is-collapsed .kitchen-col__count {
  background: rgb(255 255 255 / 0.25);
  color: #fff;
}

/* ── Column title ── */
.kitchen-col__title {
  font-size: 0.9125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(var(--bc) / 0.6); /* neutral gray when expanded */
  white-space: nowrap;
  transition: color 200ms ease, opacity 200ms ease;
}

/* Expanded: center icon, title, and count as a group; align vertically */
.kitchen-col.is-expanded .kitchen-col__expander {
  justify-content: center;
  align-items: end;
}

/* Collapsed title: white on vivid background */
.kitchen-col.is-collapsed .kitchen-col__title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: #fff;
  opacity: 0.95;
}

/* Meals column: slightly larger title, centered with icon and count */
.kitchen-col--cooking .kitchen-col__title {
  font-size: 0.9125rem;
  line-height: 1.25rem;
  display: inline-flex;
  align-items: center;
}

/* ── Column body ── */
.kitchen-col__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  /* width: 100% is required alongside mx-auto + max-w-* — without it, mx-auto
     disables flex cross-axis stretch and the body shrink-wraps to content */
  width: 100%;
}


.kitchen-col-pantry-list {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding-bottom: 1rem;
}

@media (min-width: 640px) {
  .kitchen-col-pantry-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .kitchen-col-pantry-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── Pantry card v2 — compact with image header ── */
.pantry-item-card-v2 {
  border-radius: 0.5rem;
  overflow: hidden;
  background: oklch(var(--b1));
  border: 1px solid oklch(var(--bc) / 0.06);
}

.pantry-item-card-v2__image {
  width: 100%;
  height: 55px;
  object-fit: cover;
  display: block;
}

.pantry-item-card-v2__content {
  padding: 0.4rem 0.5rem;
}

.pantry-item-card-v2__name {
  font-size: 0.85rem;
  font-weight: 500;
  color: oklch(var(--bc));
  line-height: 1.2;
  margin-bottom: 0.25rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pantry-item-card-v2__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-bottom: 0.2rem;
}

.pantry-item-card-v2__tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  white-space: nowrap;
}

.pantry-item-card-v2__actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.pantry-item-card-v2__actions form {
  display: inline-block;
}

.pantry-item-card-v2__qty {
  font-size: 0.7rem;
  color: oklch(var(--bc) / 0.4);
}

.pantry-item-card-v2__remove {
  font-size: 0.7rem;
  font-weight: 600;
  color: oklch(var(--bc) / 0.4);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.pantry-item-card-v2__remove:hover {
  color: #dc2626;
}

@media (min-width: 640px) {
  .pantry-item-card-v2__image {
    height: 70px;
  }

  .pantry-item-card-v2__name {
    font-size: 0.85rem;
  }
}

.kitchen-col-pantry-actions {
  flex-shrink: 0;
}

/* Add-ingredient form: ensure select/input text is fully visible (no top clipping) */
.kitchen-col-pantry-actions .select.select-sm,
.kitchen-col-pantry-actions .input.input-sm {
  min-height: 2rem;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  line-height: 1.35;
  box-sizing: border-box;
}

/* Pantry column buttons: use column --card-color (warm amber), white text */
.kitchen-col--pantry .kitchen-pantry-btn {
  background: var(--card-color);
  border-color: var(--card-color);
  color: #fff;
}
.kitchen-col--pantry .kitchen-pantry-btn:hover {
  background: color-mix(in srgb, var(--card-color) 85%, black);
  border-color: color-mix(in srgb, var(--card-color) 85%, black);
  color: #fff;
}

/* Pantry upload modal: "Choose File" button matches Pantry Picture orange (same as .kitchen-col--pantry --card-color) */
.file-input--pantry::file-selector-button {
  background: oklch(73% 0.17 72);
  border-color: oklch(73% 0.17 72);
  color: #fff;
}
.file-input--pantry::-webkit-file-upload-button {
  background: oklch(73% 0.17 72);
  border-color: oklch(73% 0.17 72);
  color: #fff;
}

/* Pantry upload modal: "Scan pantry" button — same orange, white text */
.btn-pantry-scan {
  background: oklch(73% 0.17 72);
  border-color: oklch(73% 0.17 72);
  color: #fff;
}
.btn-pantry-scan:hover {
  background: color-mix(in srgb, oklch(73% 0.17 72) 85%, black);
  border-color: color-mix(in srgb, oklch(73% 0.17 72) 85%, black);
  color: #fff;
}

/* Meals column CTA: same pattern as Pantry — solid --card-color (azure blue), white text */
.kitchen-col--cooking .kitchen-meal-cta {
  background: var(--card-color);
  border-color: var(--card-color);
  color: #fff;
}
.kitchen-col--cooking .kitchen-meal-cta:hover {
  background: color-mix(in srgb, var(--card-color) 85%, black);
  border-color: color-mix(in srgb, var(--card-color) 85%, black);
  color: #fff;
}

.kitchen-col.is-collapsed .kitchen-col__body {
  display: none;
}

/* ────────────────────────────────────────────
   Pantry item cards (fizzy two-zone style)
   ──────────────────────────────────────────── */

.pantry-item-card {
  border: none;
  border-radius: 0.5rem;
  /* soft hue background — ~7% tint of card color, like Fizzy's warm cream */
  background: color-mix(in srgb, var(--card-color) 7%, oklch(var(--b1)));
  overflow: hidden;
  box-shadow:
    0 1px 3px oklch(0 0 0 / 0.07),
    0 4px 16px oklch(0 0 0 / 0.08);
  transition: box-shadow 150ms ease;
}

.pantry-item-card:hover {
  box-shadow:
    0 2px 6px oklch(0 0 0 / 0.09),
    0 8px 24px oklch(0 0 0 / 0.10);
}

/* ── Top row — transparent bg; only the flag tag carries color ── */
.pantry-item-card__header {
  display: flex;
  align-items: flex-start; /* flag children hug the very top */
  padding: 0 0.75rem 0.3rem 0; /* zero left + top — flag is flush with card top-left */
  /* no border-bottom — divider removed */
}

/* Flag/tab: full saturated card color — Fizzy's strong accent on soft background */
.pantry-item-card__category {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem 0.2rem 0.625rem;
  background: var(--card-color); /* full saturated — not a tint */
  border-right: 1px solid color-mix(in srgb, var(--card-color) 60%, oklch(0% 0 0));
  border-bottom: 1px solid color-mix(in srgb, var(--card-color) 60%, oklch(0% 0 0));
  /* no border-top, no border-left — card edges serve those sides */
  border-radius: 0 0 0.35rem 0; /* only bottom-right curves */
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(98% 0.01 72); /* near-white on turmeric bg */
}

/* ── Body — white well, name + bottom row (quantity + pills) ── */
.pantry-item-card__body {
  padding: 0.5rem 0.625rem 0.4rem 0.75rem;
}

.pantry-item-card__name {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  /* warm dark tone derived from card color — not neutral black */
  color: color-mix(in srgb, var(--card-color) 30%, oklch(18% 0.04 72));
}

/* ── Bottom row: quantity (left) and "Good for" pills (right), same baseline ── */
/* ── One row: qty (left) | healing pill (center) | Remove (right), edges flush ── */
.pantry-item-card__footer-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  min-height: 1.25rem;
}

.pantry-item-card__footer-row .pantry-item-card__qty {
  flex-shrink: 0;
}

.pantry-item-card__footer-row .pantry-item-card__healing-tags {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.pantry-item-card__footer-row .pantry-item-card__remove {
  flex-shrink: 0;
}

.pantry-item-card__healing-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--card-color) 45%, transparent);
  border-radius: 9999px;
  background: color-mix(in srgb, var(--card-color) 10%, transparent);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: color-mix(in srgb, var(--card-color) 85%, oklch(15% 0.05 72));
}

.pantry-item-card__qty {
  font-size: 0.6875rem;
  font-weight: 500;
  color: oklch(var(--bc) / 0.42);
}

.pantry-item-card__remove {
  font-size: 0.6875rem;
  font-weight: 600;
  color: oklch(var(--bc) / 0.5);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.pantry-item-card__remove:hover {
  color: #dc2626;
}

/* ────────────────────────────────────────────
   Grocery cards — Fizzy-style, grouped by category
   ──────────────────────────────────────────── */

.kitchen-grocery-categories {
  display: flex;
  flex-direction: column;
  gap: 2.95rem;
}

/* ── Category group ── */
.kitchen-grocery-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.kitchen-grocery-group .kitchen-grocery-group__header {
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .kitchen-grocery-group {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .kitchen-grocery-group {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kitchen-grocery-group__header {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.kitchen-grocery-group__line {
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--card-color) 35%, oklch(var(--b3)));
}

.kitchen-grocery-group__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--card-color) 70%, oklch(var(--bc) / 0.7));
  white-space: nowrap;
}

/* ── Individual grocery card — mirrors pantry-item-card structure exactly ── */
.kitchen-grocery-card {
  border: none;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--card-color) 7%, oklch(var(--b1)));
  overflow: hidden; /* keeps qty-flag flush with card corners */
  box-shadow:
    0 1px 3px oklch(0 0 0 / 0.07),
    0 4px 16px oklch(0 0 0 / 0.08);
  transition: box-shadow 150ms ease;
}

.kitchen-grocery-card:hover {
  box-shadow:
    0 2px 6px oklch(0 0 0 / 0.09),
    0 8px 24px oklch(0 0 0 / 0.10);
}

/* ── Header zone: flag sits flush at top-left, mirrors pantry-item-card__header ── */
.kitchen-grocery-card__header {
  display: flex;
  align-items: flex-start;
  padding: 0 0.75rem 0.3rem 0;
}

/* Quantity flag: same shape/color treatment as pantry's category flag */
.kitchen-grocery-card__qty-flag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem 0.2rem 0.625rem;
  background: var(--card-color);
  border-right: 1px solid color-mix(in srgb, var(--card-color) 60%, oklch(0% 0 0));
  border-bottom: 1px solid color-mix(in srgb, var(--card-color) 60%, oklch(0% 0 0));
  border-radius: 0 0 0.35rem 0;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(98% 0.01 168); /* near-white on jade bg */
}

/* ── Body: name + bottom row, mirrors pantry-item-card__body ── */
.kitchen-grocery-card__body {
  padding: 0.5rem 0.625rem 0.4rem 0.75rem;
}

/* ── Compact grocery card v2 — small image header + name + actions ── */
.kitchen-grocery-card-v2 {
  border-radius: 0.5rem;
  overflow: hidden;
  background: oklch(var(--b1));
  border: 1px solid oklch(var(--bc) / 0.06);
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.kitchen-grocery-card-v2:hover {
  box-shadow: 0 2px 8px oklch(0 0 0 / 0.08);
}

.kitchen-grocery-card-v2__image {
  width: 100%;
  height: 55px;
  object-fit: cover;
  display: block;
}

.kitchen-grocery-card-v2__content {
  padding: 0.4rem 0.5rem;
}

.kitchen-grocery-card-v2__name {
  font-size: 0.85rem;
  font-weight: 500;
  color: oklch(var(--bc));
  line-height: 1.2;
  margin-bottom: 0.3rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.kitchen-grocery-card-v2__actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.kitchen-grocery-card-v2__actions form {
  display: inline-block;
}

@media (min-width: 640px) {
  .kitchen-grocery-card-v2__image {
    height: 70px;
  }

  .kitchen-grocery-card-v2__name {
    font-size: 0.85rem;
  }
}

/* Name: identical spec to pantry-item-card__name, hue adjusted for green */
.kitchen-grocery-card__name {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: color-mix(in srgb, var(--card-color) 30%, oklch(18% 0.04 168));
}

/* Bottom: reason text on first line, Remove + Shop buttons on second line */
.kitchen-grocery-card__bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.375rem;
}

/* Reason: muted secondary text, same register as pantry-item-card__qty */
.kitchen-grocery-card__reason {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  color: oklch(var(--bc) / 0.55);
}

/* Bottom row actions: Shop left, Remove right */
.kitchen-grocery-card__actions {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  width: 100%;
  margin-top: 0.75rem;
}

.kitchen-grocery-card__actions form {
  display: inline-block;
}

.kitchen-grocery-card__have-it {
  font-size: 0.7rem;
  font-weight: 600;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 0.375rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  transition: background 150ms ease;
}
.kitchen-grocery-card__have-it:hover {
  background: rgba(34, 197, 94, 0.15);
}

.kitchen-grocery-card__remove {
  font-size: 0.7rem;
  font-weight: 600;
  color: oklch(var(--bc) / 0.5);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  text-decoration: none;
  white-space: nowrap;
}
.kitchen-grocery-card__remove:hover {
  color: #dc2626;
}

/* Instacart / shop link: always visible, pinned bottom-right */
.kitchen-grocery-card__instacart {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  color: color-mix(in srgb, var(--card-color) 75%, oklch(var(--bc)));
  opacity: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ────────────────────────────────────────────
   Meal cards (Fizzy style — --meal-accent drives all derived colors)
   ──────────────────────────────────────────── */

.kitchen-meal-card {
  border: 1px solid color-mix(in srgb, var(--meal-accent, oklch(var(--b3))) 20%, oklch(var(--b3)));
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--meal-accent, oklch(var(--b3))) 10%, oklch(var(--b1)));
  overflow: hidden; /* keeps flag flush with card corners */
  box-shadow:
    0 1px 3px oklch(0 0 0 / 0.06),
    0 4px 16px oklch(0 0 0 / 0.07);
  transition: box-shadow 150ms ease;
}

.kitchen-meal-card:hover {
  box-shadow:
    0 2px 6px oklch(0 0 0 / 0.09),
    0 8px 24px oklch(0 0 0 / 0.10);
}

/* ── Header: flag flush top-left + prep time top-right ── */
.kitchen-meal-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 0.75rem;  /* right side breathing room; flag is zero-margin */
}

/* Meal type flag — same shape/treatment as pantry-item-card__category */
.kitchen-meal-card__type-flag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem 0.2rem 0.625rem;
  background: var(--meal-accent);
  border-right: 1px solid color-mix(in srgb, var(--meal-accent) 60%, oklch(0% 0 0));
  border-bottom: 1px solid color-mix(in srgb, var(--meal-accent) 60%, oklch(0% 0 0));
  border-radius: 0 0 0.35rem 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(98% 0.01 0 / 0.95);
}

/* Prep time — top-right, muted, matches pantry-item-card__qty register */
.kitchen-meal-card__prep {
  font-size: 0.6875rem;
  font-weight: 500;
  color: oklch(var(--bc) / 0.42);
}

/* ── Body: name, description, ingredients ── */
.kitchen-meal-card__body {
  padding: 0.625rem 0.875rem 0.75rem;
}

.kitchen-meal-card__name {
  font-size: 1.50rem;
  font-weight: 800;
  line-height: 1.3;
  color: color-mix(in srgb, var(--meal-accent) 35%, oklch(18% 0.04 0));
  text-wrap: pretty;
  margin: 0 0 0.5rem;
  margin-bottom: 1.3rem;
  margin-top: 1rem;
}

.kitchen-meal-card__desc {
  font-size: 1rem;
  font-weight: 400;
  color: oklch(var(--bc) / 0.68);
  line-height: 1.55;
  text-wrap: pretty;
  margin: 0 0 0.75rem;
  margin-bottom: 1.3rem;
}

/* Ingredients block */
.kitchen-meal-card__ingredients-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kitchen-meal-card__ingredients {
  font-size: 1rem;
  color: oklch(var(--bc) / 0.6);
  line-height: 1.45;
  margin: 0;
}

.kitchen-meal-card__ing-label {
  font-weight: 700;
  font-size: 0.999rem;
  letter-spacing: 0.04em;
  margin-right: 0.15rem;
}

.kitchen-meal-card__ing-label--pantry { color: #16a34a; }
.kitchen-meal-card__ing-label--buy    { color: #d97706; }

/* ── Dosha zone: visually separated, lightly tinted, soft italic ── */
.kitchen-meal-card__dosha-zone {
  margin: 0 0.75rem;
  margin-top: 1rem;
  padding: 0.625rem 0.75rem;
  border-top: 1px solid color-mix(in srgb, var(--meal-accent) 15%, oklch(var(--b3)));
  background: color-mix(in srgb, var(--meal-accent) 7%, oklch(var(--b2)));
  border-radius: 0 0 0.375rem 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.kitchen-meal-card__dosha-note {
  font-size: 0.955rem;
  font-weight: 400;
  font-style: italic;
  color: oklch(var(--bc) / 0.62);
  line-height: 1.55;
  text-wrap: pretty;
  margin: 0;
}

/* ── Footer: See recipe ── */
.kitchen-meal-card__footer {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.5rem 0.875rem 0.625rem;
}

.kitchen-meal-recipe-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
  margin-top: .7rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--meal-accent) 80%, oklch(var(--bc)));
  letter-spacing: 0.02em;
  transition: opacity 120ms ease;
}

.kitchen-meal-recipe-link:hover {
  opacity: 0.7;
}

/* ── Meal card image (below header, above body) ── */
.kitchen-meal-card__image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: color-mix(in srgb, var(--meal-accent, oklch(var(--b3))) 10%, oklch(var(--b2)));
}

.kitchen-meal-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 300ms ease;
}

.kitchen-meal-card__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: oklch(var(--b2));
}

.kitchen-meal-card__generating-spinner {
  color: oklch(var(--bc) / 0.35);
  width: 1.4rem;
  height: 1.4rem;
}

.kitchen-meal-card__generating-text {
  font-size: 0.7rem;
  color: oklch(var(--bc) / 0.45);
  letter-spacing: 0.01em;
}

.kitchen-meal-card__dot {
  animation: meal-dot-pulse 1.4s ease-in-out infinite;
  opacity: 0;
}
.kitchen-meal-card__dot:nth-child(2) { animation-delay: 0.2s; }
.kitchen-meal-card__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes meal-dot-pulse {
  0%, 80%, 100% { opacity: 0; }
  40%           { opacity: 1; }
}

/* ────────────────────────────────────────────
   Meal recipe modal
   ──────────────────────────────────────────── */

.kitchen-recipe-modal {
  border-radius: 1rem;
  max-height: 90vh;
  overflow-y: auto;
}

/* Image zone */
.kitchen-recipe-modal__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: color-mix(in srgb, var(--meal-accent, oklch(var(--b3))) 15%, oklch(var(--b2)));
  border-bottom: 3px solid var(--meal-accent, oklch(var(--b3)));
}

.kitchen-recipe-modal__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kitchen-recipe-modal__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.kitchen-recipe-modal__image-icon {
  font-size: 3rem;
  opacity: 0.4;
}

.kitchen-recipe-modal__generating-spinner {
  color: oklch(var(--bc) / 0.35);
  width: 2rem;
  height: 2rem;
}

.kitchen-recipe-modal__image-hint {
  font-size: 0.8125rem;
  color: oklch(var(--bc) / 0.45);
  margin: 0;
}

/* Content area */
.kitchen-recipe-modal__body {
  padding: 1.25rem 1.5rem 1.75rem;
}

.kitchen-recipe-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.kitchen-recipe-modal__title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0.25rem 0 0;
}

.kitchen-recipe-modal__desc {
  font-size: 0.9rem;
  line-height: 1.85;
  color: oklch(var(--bc) / 0.7);
  background: none;
  margin: 0;
  padding: 0.35rem 0;
}

.kitchen-recipe-modal__section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(var(--bc) / 0.45);
  margin: 1rem 0 0.5rem;
}

/* Ingredients */
.kitchen-recipe-modal__ingredients {
  list-style: none;
  padding: 0;
  margin: 0 0 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.kitchen-recipe-modal__ingredients li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: oklch(var(--bc) / 0.85);
}

.kitchen-recipe-modal__ingredient-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.kitchen-recipe-modal__ingredient-key {
  font-size: 0.6875rem;
  color: oklch(var(--bc) / 0.45);
  margin: 0 0 1.25rem;
}

/* Extra breathing room above "How to make it" / "Instructions" when preceded by ingredients */
.kitchen-recipe-modal__ingredient-key + .kitchen-recipe-modal__section-label {
  margin-top: 1.75rem;
}

/* Recipe steps */
.kitchen-recipe-modal__steps {
  padding-left: 1.375rem;
  margin: 0 0 1.25rem;
  list-style-type: decimal;
}

.kitchen-recipe-modal__steps li {
  font-size: 0.875rem;
  line-height: 1.5;
  color: oklch(var(--bc) / 0.85);
  margin-bottom: 0.5rem;
}

/* Dosha zone wrapper */
.kitchen-recipe-modal__dosha-zone {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 1.25rem 0 1.75rem;
  padding: 0.75rem 1rem;
  background: oklch(var(--b2));
  border-radius: 0.5rem;
}

/* Dosha note — individual sentence */
.kitchen-recipe-modal__dosha-note {
  font-size: 0.875rem;
  font-weight: 600;
  color: oklch(var(--n));
  margin: 0;
}

/* ── "New Meal Idea" fizzy-style dashed add button ── */
.kitchen-new-meal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1.5px dashed oklch(var(--b3));
  background: transparent;
  color: oklch(var(--bc) / 0.55);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.kitchen-new-meal-btn:hover {
  border-color: oklch(var(--p) / 0.5);
  color: oklch(var(--p));
  background: oklch(var(--p) / 0.05);
}

/* ── Mobile tab bar (hidden on desktop) ── */

.kitchen-mobile-tabs {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .kitchen-band {
    padding: 1.125rem 0.375rem;
    border-radius: 0.875rem;
  }

  .kitchen-band-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-left: 0;
  }

  .kitchen-dosha-badge {
    text-align: center;
  }

  .kitchen-inner {
    padding: 0.625rem 0.25rem;
    border-radius: 0.625rem;
  }

  .kitchen-col__body {
    padding: 1rem 0.25rem;
  }

  /* Board wraps so the tab bar sits above columns as a full-width first row */
  .kitchen-board {
    flex-wrap: wrap;
    min-height: 50vh;
    gap: 0;
  }

  /* Tab bar: spans full width, pinned above columns via order: -1 */
  .kitchen-mobile-tabs {
    display: flex;
    flex-wrap: wrap;
    order: -1;
    width: 100%;
    gap: 0.25rem;
    padding: 0 0.25rem 0.75rem;
    border-bottom: 1px solid oklch(var(--b3) / 0.5);
    margin-bottom: 0.625rem;
    flex-shrink: 0;
    overflow: hidden;
  }

  .kitchen-tab-btn {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.2rem;
    border-radius: 0.625rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: oklch(var(--bc) / 0.45);
    transition: color 150ms ease, background 150ms ease;
    white-space: nowrap;
  }

  .kitchen-tab-btn.is-active {
    background: oklch(var(--b2));
    color: oklch(var(--bc) / 0.85);
  }

  .kitchen-tab-btn__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.15rem;
    border-radius: 9999px;
    background: oklch(var(--b3) / 0.6);
    font-size: 0.5rem;
    font-weight: 700;
  }

  .kitchen-tab-btn.is-active .kitchen-tab-btn__count {
    background: color-mix(in srgb, var(--card-color, oklch(var(--p))) 18%, oklch(var(--b1)));
    color: var(--card-color, oklch(var(--p)));
  }

  /* Collapsed columns: hidden entirely — pills replaced by tab bar */
  .kitchen-col.is-collapsed {
    display: none;
  }

  /* Expanded column: full width below the tab bar */
  .kitchen-col.is-expanded {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    border-radius: 0.75rem;
  }

  /* Hide per-column header on mobile — tabs handle navigation */
  .kitchen-col__header {
    display: none;
  }

}

/* ────────────────────────────────────────────
   Grocery list loading (Fizzy-style)
   ──────────────────────────────────────────── */

.kitchen-grocery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 2rem 1rem;
  text-align: center;
}

.kitchen-grocery-loading__bubbles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.kitchen-grocery-loading__bubble {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: oklch(54% 0.14 168);
  animation: kitchen-grocery-bubble 1.4s ease-in-out infinite both;
}

.kitchen-grocery-loading__bubble:nth-child(1) { animation-delay: 0s; }
.kitchen-grocery-loading__bubble:nth-child(2) { animation-delay: 0.16s; }
.kitchen-grocery-loading__bubble:nth-child(3) { animation-delay: 0.32s; }
.kitchen-grocery-loading__bubble:nth-child(4) { animation-delay: 0.48s; }
.kitchen-grocery-loading__bubble:nth-child(5) { animation-delay: 0.64s; }

@keyframes kitchen-grocery-bubble {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.kitchen-grocery-loading__text {
  font-size: 0.9375rem;
  font-weight: 600;
  color: oklch(30% 0.04 168);
  margin: 0 0 0.25rem;
}

.kitchen-grocery-loading__subtext {
  font-size: 0.8125rem;
  color: oklch(50% 0.06 168 / 0.85);
  margin: 0;
}

/* Grocery CTA button: white text, increased letter-spacing */
.kitchen-grocery-cta {
  color: #fff !important;
  letter-spacing: 0.06em;
}

/* Empty and generating states: same vertical rhythm so label + button stay in place */
.grocery-frame-empty {
  padding: 1.5rem 0;
}
.grocery-frame-empty__label {
  display: block;
  margin-bottom: 0.75rem;
}
.grocery-frame__middle {
  min-height: 8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.grocery-frame-empty__btn {
  margin-top: 0;
}

/* Generating state: compact loading block inside fixed-height middle */
.kitchen-grocery-loading--compact {
  min-height: 0;
  padding: 0.5rem 1rem;
}
.kitchen-grocery-loading--compact .kitchen-grocery-loading__bubbles {
  margin-bottom: 0.5rem;
}

/* ── Retailer Picker ── */
.kitchen-retailer-menu {
  background: color-mix(in srgb, var(--card-color) 6%, oklch(var(--b1)));
  border: 1px solid color-mix(in srgb, var(--card-color) 20%, oklch(var(--b1)));
  border-radius: 1rem;
  box-shadow:
    0 2px 8px oklch(0 0 0 / 0.08),
    0 8px 32px oklch(0 0 0 / 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 13rem;
  padding: 0.5rem;
  transform-origin: top right;
  animation: retailer-menu-in 180ms cubic-bezier(0.25, 1.25, 0.5, 1) both;
  z-index: 10;
}

@keyframes retailer-menu-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.kitchen-retailer-option {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 0.625rem;
  cursor: pointer;
  display: flex;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  transition: background 120ms ease;
  width: 100%;
}

.kitchen-retailer-option:hover,
.kitchen-retailer-option:focus-visible {
  background: color-mix(in srgb, var(--card-color) 10%, oklch(var(--b1)));
}

.kitchen-retailer-btn--active {
  background: color-mix(in srgb, var(--card-color) 16%, oklch(var(--b1)));
}

.kitchen-retailer-option__emoji { font-size: 1.125rem; flex-shrink: 0; }

.kitchen-retailer-option__name {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--card-color) 40%, oklch(18% 0.04 168));
}

.kitchen-retailer-option__go {
  flex-shrink: 0;
  font-size: 0.75rem;
}
