/* ══════════════════════════════════════════════════════════════════════════
   04-chef-kim.css — PlantPure Kitchen stylesheet 4 of 6
   Extracted verbatim from index.html lines 1683-2167 (baseline fa8b59c).
   Contents: Ask Chef Kim (layout, intro/profile, chips, chat, typing
   indicator, recipe bubbles) including BOTH in-region ≤640px override
   blocks (baseline 1840-1858 with its !important sticky-intro fix, and
   1871-1876), in source order. These duplicate rules from the mobile
   system in 03-responsive-print.css and win on source order — keep order.

   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 ─── */

/* ── ASK CHEF KIM ── */
.chefkim-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .chefkim-layout { grid-template-columns: 1fr; }
}
.chefkim-intro {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(107,37,16,0.06);
  position: sticky;
  top: 1rem;
}
.chefkim-profile {
  background: linear-gradient(135deg, var(--terra-deeper), var(--terra-dark));
  padding: 1.5rem;
  color: white;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.kim-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
  object-fit: cover;
  flex-shrink: 0;
}
.chefkim-profile-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin-bottom: 0.15rem;
}
.kim-title {
  font-size: 0.75rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}
.kim-bio {
  font-size: 0.82rem;
  line-height: 1.55;
  opacity: 0.9;
  margin-bottom: 0;
}
.kim-ai-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.5;
  opacity: 0.85;
}
.ai-badge {
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.kim-starter-chips-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terra);
  padding: 0.85rem 1rem 0.4rem;
}
.kim-starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-top: 1px solid var(--border-light);
}
.kim-chip {
  background: var(--terra-xlight);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  color: var(--terra-dark);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.kim-chip:hover { background: var(--terra); color: white; border-color: var(--terra); }
/* PPK-1.1.21 — Selected state for starter-pack chips. Mirrors the hover
   look but is persistent: filled terra background + white text + a soft
   ring so the tap target is unambiguous after selection. */
.kim-chip.selected {
  background: var(--terra);
  color: white;
  border-color: var(--terra);
  box-shadow: 0 0 0 2px rgba(140,50,20,0.15);
  font-weight: 600;
}
.kim-chip.selected::before {
  content: '\2728\00a0'; /* sparkle + non-breaking space */
}
.kim-chip-scratch {
  background: white;
  border: 1px solid var(--terra);
  color: var(--terra);
}
.kim-chip-scratch:hover { background: var(--terra); color: white; }
/* Scratch button keeps its ✦ glyph inline in the text, so suppress the
   ::before sparkle when selected and let the existing label render as-is. */
.kim-chip-scratch.selected::before { content: none; }
.kim-guide {
  padding: 0.35rem 1.25rem 0.75rem;
}
.kim-guide-lead {
  font-size: 0.85rem;
  color: var(--espresso-light);
  line-height: 1.5;
  margin: 0 0 0.55rem;
}
.kim-examples {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Illustrative only — not clickable. */
.kim-examples li {
  font-size: 0.82rem;
  color: var(--terra-dark);
  font-style: italic;
  line-height: 1.4;
  padding: 0.28rem 0.7rem;
  border-left: 2px solid var(--border);
  margin-bottom: 0.3rem;
}

/* Mobile: hide intro elements that take too much vertical space.
   Sourced AFTER the .kim-bio / .kim-ai-note / .kim-suggestions definitions
   above so this wins on source order at equal specificity. */
@media (max-width: 640px) {
  .kim-bio { display: none; }
  .kim-ai-note { display: none; }
  .kim-guide { display: none; }
  .kim-starter-chips-label { font-size: 0.7rem; padding: 0.35rem 0.65rem 0; }
  .kim-starter-chips { gap: 0.35rem; padding: 0.35rem 0.5rem 0.5rem; }
  .kim-chip { font-size: 0.78rem; padding: 0.3rem 0.65rem; }
  .chefkim-intro {
    /* Make intro compact when other rules apply */
    padding-bottom: 0.3rem;
    /* PPK-1.1.24 — Ensure intro is never sticky on mobile so the chat
       and recipe area scroll freely without the banner pinned. */
    position: static !important;
    top: auto !important;
  }
  .chefkim-profile { padding: 0.65rem 0.85rem; }
  .chefkim-profile-text h2 { font-size: 1.1rem; margin: 0; }
  .chefkim-profile-text .kim-title { font-size: 0.7rem; margin-top: 0.1rem; }
}

/* Chat */
.chefkim-chat {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(107,37,16,0.06);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 80vh;
}
@media (max-width: 640px) {
  .chefkim-chat {
    min-height: 0;
    max-height: none;
  }
}
.chat-messages {
  flex: 0 1 auto;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 0;
}
.chat-welcome {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--terra-xlight);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.chat-welcome-icon { font-size: 1.5rem; flex-shrink: 0; }
.chat-welcome p { font-size: 0.9rem; color: var(--espresso-light); line-height: 1.6; }
.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.chat-msg.user { align-items: flex-end; }
.chat-msg.assistant { align-items: flex-start; }
.chat-bubble {
  max-width: 85%;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.6;
}
.chat-msg.user .chat-bubble {
  background: var(--terra);
  color: white;
  border-radius: 12px 12px 2px 12px;
}
.chat-msg.assistant .chat-bubble {
  background: var(--terra-xlight);
  border: 1px solid var(--border);
  color: var(--espresso);
  border-radius: 12px 12px 12px 2px;
}
/* Recipe card styling within chat */
.chat-bubble .recipe-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--terra-dark);
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
.chat-bubble .recipe-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--terra);
  margin: 0.85rem 0 0.4rem;
}
.chat-bubble .recipe-ing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.chat-bubble .recipe-ing-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
}
.chat-bubble .recipe-ing-list li:last-child { border-bottom: none; }
.chat-bubble .recipe-steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.chat-bubble .recipe-steps-list li {
  display: flex;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  line-height: 1.6;
}
.chat-bubble .recipe-steps-list li:last-child { border-bottom: none; }
.chat-bubble .step-n {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--terra);
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
}
.chat-bubble .recipe-note {
  font-size: 0.78rem;
  color: var(--warm-gray);
  font-style: italic;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

/* Recipe formatting — applies in both chat bubbles and saved recipe modal */
.recipe-para { margin: 0.25rem 0; font-size: 0.88rem; line-height: 1.6; }
.recipe-card-title,
.modal-body .recipe-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--terra-dark);
  margin-bottom: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
.recipe-section-label,
.modal-body .recipe-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--terra);
  margin: 0.75rem 0 0.3rem;
}
.modal-body .recipe-ing-list {
  list-style: none; padding: 0; margin: 0;
}
.modal-body .recipe-ing-list li {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
}
.modal-body .recipe-ing-list li:last-child { border-bottom: none; }
.modal-body .recipe-steps-list {
  list-style: none; padding: 0; margin: 0;
}
.modal-body .recipe-steps-list li {
  display: flex;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
  line-height: 1.6;
}
.modal-body .recipe-steps-list li:last-child { border-bottom: none; }
.modal-body .step-n {
  flex-shrink: 0;
  width: 20px; height: 20px;
  background: var(--terra);
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
}
.chat-bubble .no-pack-badge {
  display: inline-block;
  background: var(--terra-xlight);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
  color: var(--warm-gray);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.chat-msg-label {
  font-size: 0.72rem;
  color: var(--warm-gray);
  padding: 0 0.25rem;
}
.chat-typing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--terra-xlight);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: fit-content;
}
.typing-dots {
  display: flex;
  gap: 4px;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--terra);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}
.chat-input-area {
  padding: 0.85rem 1.25rem 1rem;
}
.chat-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.5;
  color: var(--espresso);
  caret-color: var(--terra);
}
.chat-input:focus { border-color: var(--terra); }
.chat-send-btn {
  background: var(--terra);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-send-btn:hover { background: var(--terra-dark); }
.chat-send-btn:disabled { background: var(--warm-gray); cursor: not-allowed; }
.chat-input-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}
#chatHistoryNote {
  font-size: 0.75rem;
  color: var(--warm-gray);
}
.chat-clear-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--warm-gray);
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
}
.chat-clear-btn:hover { color: var(--terra); }
.chat-recipe-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.chat-print-btn {
  background: var(--terra-xlight);
  border: 1.5px solid var(--terra);
  color: var(--terra-dark);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.chat-print-btn:hover { background: var(--terra); color: white; }
