/* ══════════════════════════════════════════════════════════════════════════
   05-kitchen.css — PlantPure Kitchen stylesheet 5 of 6
   Extracted verbatim from index.html lines 2168-2683 (baseline fa8b59c).
   Contents: Community Cookbook, My Kitchen / recipe box, rs-* recipe
   selection mode, Ki grocery card. Contains the orphaned parse-error block
   at baseline lines 2469-2479 (a rule body with no selector, after
   .ki-filter-btn.active) — it is PRESERVED BROKEN on purpose, kept in-file
   with its following rule; do not "fix" it.

   DO NOT REORDER these six CSS files, their <link> tags in index.html, or
   any rules within them: the cascade depends on source order. Do not edit
   or reformat the rules below — scripts/check-css.mjs byte-compares the
   concatenation of all six files (headers stripped) in <link> order
   against baseline fa8b59c lines 28-3410.
   ─── end header — verbatim baseline CSS begins on the next line ─── */

/* ── COMMUNITY COOKBOOK ── */
.cb-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.cb-filter-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.cb-share-prompt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--terra-xlight);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: var(--espresso-light);
  margin-bottom: 1.25rem;
}
.cb-link-btn {
  background: none;
  border: none;
  color: var(--terra);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}
.cb-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--terra);
  margin: 1.5rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-light);
}
.cb-recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.cb-recipe-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(107,37,16,0.06);
  transition: box-shadow 0.2s;
}
.cb-recipe-card:hover { box-shadow: 0 4px 16px rgba(107,37,16,0.12); }
.cb-recipe-card-header {
  background: linear-gradient(135deg, var(--terra-dark), var(--terra));
  color: white;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.cb-recipe-card-header h4 {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  line-height: 1.3;
}
.cb-category-badge {
  background: rgba(255,255,255,0.2);
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.cb-recipe-card-body { padding: 0.85rem 1rem; }
.cb-recipe-meta {
  font-size: 0.8rem;
  color: var(--warm-gray);
  margin-bottom: 0.5rem;
}
.cb-stars-display {
  color: #E8A020;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}
.cb-recipe-card-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.cb-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--warm-gray);
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.cb-empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.cb-empty h3 { font-family: 'Playfair Display', serif; color: var(--espresso-light); margin-bottom: 0.4rem; }

/* ── MY KITCHEN ── */
.ki-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.ki-tab {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: white;
  color: var(--warm-gray);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}
.ki-tab.active { border-color: var(--terra); background: var(--terra); color: white; }
.ki-tab-sm {
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  color: var(--warm-gray);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.15s;
}
.ki-tab-sm.active { border-color: var(--terra); background: var(--terra); color: white; }
.ki-panel { display: none; }
.ki-panel.active { display: block; }
.ki-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.ki-search-wrap { flex: 1; min-width: 200px; }
.ki-search {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.ki-search:focus { border-color: var(--terra); }
.ki-count { font-size: 0.82rem; color: var(--warm-gray); white-space: nowrap; }
.ki-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--warm-gray);
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.ki-empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.ki-empty h3 { font-family: 'Playfair Display', serif; color: var(--espresso-light); margin-bottom: 0.4rem; }
.ki-empty p { font-size: 0.88rem; }
.ki-recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.ki-recipe-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(107,37,16,0.06);
  transition: box-shadow 0.2s;
}
.ki-recipe-card:hover { box-shadow: 0 4px 16px rgba(107,37,16,0.12); }
.ki-recipe-card-header {
  background: linear-gradient(135deg, var(--terra-dark), var(--terra));
  color: white;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.ki-recipe-card-header h4 { font-family: 'Playfair Display', serif; font-size: 0.95rem; line-height: 1.3; }
.ki-pack-badge {
  background: rgba(255,255,255,0.2);
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ki-recipe-card-body { padding: 0.85rem 1rem; }
.ki-recipe-card-body p { font-size: 0.92rem; color: var(--espresso-light); line-height: 1.5; margin-bottom: 0.75rem; }
.ki-recipe-card-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.ki-btn-primary {
  background: var(--terra);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s;
}
.ki-btn-primary:hover { background: var(--terra-dark); }
.ki-btn-outline {
  background: transparent;
  color: var(--terra);
  border: 1px solid var(--terra);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}
.ki-btn-outline:hover { background: var(--terra); color: white; }
.ki-btn-ghost {
  background: transparent;
  color: var(--warm-gray);
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  transition: all 0.15s;
}
.ki-btn-ghost:hover { border-color: var(--warm-gray); color: var(--espresso); }
.ki-btn-danger {
  background: transparent;
  color: #C0392B;
  border: 1px solid #FCC;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  transition: all 0.15s;
}
.ki-btn-danger:hover { background: #C0392B; color: white; border-color: #C0392B; }
.ki-stars {
  display: flex;
  gap: 0.15rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.ki-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
  transition: transform 0.1s;
  color: #ddd;
}
.ki-star:hover, .ki-star.lit { color: #E8A020; }
.ki-star:hover { transform: scale(1.2); }
.ki-rating-label {
  font-size: 0.72rem;
  color: var(--warm-gray);
  margin-left: 0.25rem;
}
.ki-filter-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.ki-filter-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: white;
  color: var(--warm-gray);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.15s;
}
.ki-filter-btn.active { background: var(--terra); border-color: var(--terra); color: white; }
  margin-top: 1.25rem;
  background: var(--terra-xlight);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  color: var(--warm-gray);
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

/* Planner */
.ki-week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.ki-week-header h3 { font-family: 'Playfair Display', serif; color: var(--terra-dark); }
.ki-week-grid { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.ki-week-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.15s;
}
.ki-week-item:hover { border-color: var(--terra); }
.ki-week-item-name { flex: 1; font-size: 0.92rem; font-weight: 500; color: var(--espresso); }
.ki-week-item-source { font-size: 0.75rem; color: var(--warm-gray); }
/* A planned meal whose name opens its recipe when tapped. */
.ppk-tap { cursor: pointer; color: var(--terra-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.ppk-tap:hover { color: var(--terra); }
.ppk-tap:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; border-radius: 3px; }
.ki-add-row { margin: 1rem 0; }
.ki-structured-toggle { display: flex; gap: 0.4rem; margin: 1.5rem 0 1rem; }

/* Recipe Selection mode (My Planner > Recipe Selection) */
.rs-intro { background: var(--terra-xlight); border-radius: 10px; padding: 0.85rem 1.1rem; margin-bottom: 1.1rem; }
.rs-intro p { font-size: 0.88rem; color: var(--espresso-light); line-height: 1.5; margin: 0; }
.rs-section { background: white; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.85rem; overflow: hidden; }
.rs-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; cursor: pointer; user-select: none;
  background: var(--cream); border-bottom: 1px solid var(--border);
}
.rs-section-header:hover { background: var(--terra-xlight); }
.rs-section-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; color: var(--terra-dark); margin: 0; font-weight: 700; }
.rs-section-meta { font-size: 0.78rem; color: var(--warm-gray); margin-left: 0.6rem; }
.rs-section-chevron { font-size: 0.85rem; color: var(--warm-gray); }
.rs-section-body { padding: 0.4rem 0; }
.rs-section[data-open="false"] .rs-section-body { display: none; }
.rs-section[data-open="false"] .rs-section-header { border-bottom: none; }
.rs-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 1rem; border-bottom: 1px solid #f5efeb;
}
.rs-row:last-child { border-bottom: none; }
.rs-row.has-selection { background: #fffaf6; }
.rs-row-info { flex: 1; min-width: 0; }
.rs-row-title { font-weight: 600; font-size: 0.92rem; color: var(--espresso); }
.rs-row-desc { font-size: 0.78rem; color: var(--warm-gray); margin-top: 0.1rem; line-height: 1.35; }
.rs-stepper { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.rs-step-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: white; color: var(--terra-dark); font-size: 1.1rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: inherit; padding: 0; line-height: 1;
}
.rs-step-btn:hover:not(:disabled) { background: var(--terra-xlight); border-color: var(--terra); }
.rs-step-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.rs-step-val { min-width: 2.2rem; text-align: center; font-weight: 700; color: var(--espresso); font-size: 0.95rem; }
.rs-step-unit { font-size: 0.7rem; color: var(--warm-gray); margin-left: 0.15rem; min-width: 3.5rem; }
.rs-actions-bar {
  position: sticky; bottom: 0; background: white; border: 1px solid var(--border);
  border-radius: 10px; padding: 0.85rem 1rem; margin-top: 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  box-shadow: 0 -2px 8px rgba(107,37,16,0.06); flex-wrap: wrap;
}
.rs-summary { font-size: 0.88rem; color: var(--espresso); font-weight: 500; }
.rs-summary.has-items { color: var(--terra-dark); font-weight: 600; }
.rs-actions-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.rs-generate-btn { padding: 0.55rem 1.1rem; font-size: 0.88rem; }
.rs-generate-btn:disabled { opacity: 0.4; cursor: not-allowed; }
@media (max-width: 640px) {
  .rs-row { flex-direction: row; padding: 0.6rem 0.75rem; }
  .rs-actions-bar { flex-direction: column; align-items: stretch; }
  .rs-actions-btns { justify-content: flex-end; }
}

/* Recipe Selection — generated grocery list output */
.rs-grocery-card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.25rem 1.25rem; margin-top: 1rem;
}
.rs-grocery-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border); padding-bottom: 0.6rem; margin-bottom: 0.85rem;
}
.rs-grocery-header h3 {
  font-family: 'Playfair Display', serif; color: var(--terra-dark);
  margin: 0; font-size: 1.15rem;
}
.rs-grocery-section { margin-top: 0.5rem; }
.rs-grocery-section h4 {
  font-family: 'Playfair Display', serif; color: var(--terra-dark);
  margin: 0.85rem 0 0.5rem; font-size: 1rem; font-weight: 700;
}
.rs-gl-list { display: flex; flex-direction: column; gap: 0.15rem; }
.rs-gl-item {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.4rem 0.25rem; border-bottom: 1px dotted #efe6df;
  font-size: 0.92rem;
}
.rs-gl-item:last-child { border-bottom: none; }
.rs-gl-item-name { color: var(--espresso); flex: 1; min-width: 0; }
.rs-gl-item-amt { color: var(--terra-dark); font-weight: 600; padding-left: 0.75rem; white-space: nowrap; }
.ki-day-grid { display: grid; gap: 0.75rem; }
.ki-day-row {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.ki-day-label {
  background: var(--terra-xlight);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terra-dark);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ki-day-slot {
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  color: var(--warm-gray);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.4rem;
}
.ki-day-slot:last-child { border-bottom: none; }
.ki-day-slot.filled { color: var(--espresso); font-style: normal; font-weight: 500; }
.ki-day-slot-add {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--warm-gray);
  font-size: 0.82rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}
.ki-day-slot-add:hover { background: var(--terra-xlight); border-color: var(--terra); color: var(--terra); }
.ki-day-slot-name { flex: 1; font-size: 0.88rem; }
.ki-day-slot-remove {
  background: none;
  border: none;
  color: var(--warm-gray);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.25rem;
  margin-left: 0.5rem;
  flex-shrink: 0;
  line-height: 1;
}
.ki-day-slot-remove:hover { color: var(--terra); }
.ki-planner-intro { margin-bottom: 1.25rem; }
.ki-planner-intro p { font-size: 0.95rem; color: var(--espresso-light); }

/* Add to plan list */
.ki-add-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-light);
  gap: 1rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
}
.ki-add-list-item:hover { background: var(--terra-xlight); }
.ki-add-list-item:last-child { border-bottom: none; }
.ki-add-item-name { font-size: 0.9rem; font-weight: 500; }
.ki-add-item-source { font-size: 0.75rem; color: var(--warm-gray); }

/* Grocery list */
.ki-grocery-section { margin-bottom: 1.5rem; }
.ki-grocery-section h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--terra);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-light);
}
.ki-grocery-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 8px rgba(107,37,16,0.06);
}
