/* AI Chef panel / page — shared with Recipes modal (Phase 1) and landing page (Phase 2+). */

.ai-chef-page {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: min(70vh, 40rem);
  padding: 1.25rem 1rem 2.5rem;
  background:
    linear-gradient(180deg, rgba(255, 248, 239, 0.92) 0%, rgba(253, 232, 208, 0.55) 45%, rgba(255, 255, 255, 0.75) 100%);
}

.ai-chef-page-inner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.15rem 1.2rem 1.35rem;
  border-radius: 1rem;
  background: rgba(255, 252, 248, 0.72);
  border: 1px solid rgba(194, 65, 12, 0.12);
  box-shadow: 0 12px 36px rgba(41, 37, 36, 0.08);
}

/*
  Chef art fills the card at original scale; centered so hat and face stay visible.
*/
.ai-chef-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.ai-chef-page-content {
  position: relative;
  z-index: 1;
}

.ai-chef-page-header h1 {
  margin: 0 0 1rem;
  font-size: 1.65rem;
  font-weight: 650;
  color: var(--accent-deep, #9a3412);
}

.ai-chef-gate {
  padding: 0.25rem 0 0.5rem;
}

.ai-chef-panel--page {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ai-chef-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.td-ai-chef-greeting {
  margin: 0 0 0.55rem;
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.4;
  color: var(--accent-deep, #9a3412);
}

.td-ai-chef-hint {
  margin: 0 0 0.45rem;
  line-height: 1.4;
}

.td-ai-chef-disclaimer {
  margin: 0 0 0.75rem;
  line-height: 1.35;
}

.td-ai-chef-prompt {
  min-height: 7rem;
  resize: vertical;
  /* 50% transparent box; typed text stays solid. */
  background-color: rgba(255, 255, 255, 0.5) !important;
  color: #1c1917;
  caret-color: #1c1917;
}

.td-ai-chef-prompt::placeholder {
  color: rgba(28, 25, 23, 0.55);
}

.td-ai-chef-prompt:focus {
  background-color: rgba(255, 255, 255, 0.5) !important;
  color: #1c1917;
}

.td-ai-chef-prompt:disabled {
  background-color: rgba(255, 255, 255, 0.4) !important;
  color: #1c1917;
  opacity: 1;
}

.td-ai-chef-chip-groups {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.85rem 0 0.25rem;
  max-height: min(40vh, 18rem);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.td-ai-chef-chip-group-title {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #7c2d12;
}

.td-ai-chef-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.td-ai-chef-chip {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fffaf5;
  color: #9a3412;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.25;
  cursor: pointer;
  text-align: left;
}

.td-ai-chef-chip:hover:not(:disabled) {
  background: #ffedd5;
  border-color: #fdba74;
}

.td-ai-chef-chip:disabled {
  opacity: 0.45;
  cursor: default;
}

.td-ai-chef-status {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.td-ai-chef-status.is-ok {
  color: #14532d;
}

.td-ai-chef-status.is-err {
  color: #9f1239;
}

@media (max-width: 700px) {
  .ai-chef-page {
    min-height: min(62vh, 32rem);
    padding: 0.85rem 0.65rem 1.75rem;
  }

  .ai-chef-page-inner {
    padding: 1rem 0.9rem 1.15rem;
    border-radius: 0.85rem;
  }

  .ai-chef-card-bg {
    opacity: 0.3;
    object-position: center center;
  }

  .ai-chef-page-header h1 {
    font-size: 1.4rem;
  }
}

@media (min-width: 901px) {
  .ai-chef-card-bg {
    opacity: 0.44;
    object-position: center center;
  }
}

/* Phase 4 — AI Planning Chef */
.ai-chef-mode-tabs {
  margin-bottom: 1rem;
  background: rgba(255, 250, 244, 0.9);
}

.ai-plan-recipe-select {
  margin-bottom: 0.75rem;
}

.ai-plan-confirm {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.35rem 0 0.25rem;
}

.ai-plan-confirm-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--accent-deep, #9a3412);
}

.ai-plan-compromises-lead {
  margin: 0.65rem 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.ai-plan-compromises-list {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.ai-plan-confirm-lead,
.ai-plan-confirm-rationale {
  margin: 0;
  line-height: 1.45;
}

.ai-plan-confirm-meta,
.ai-plan-busy-list {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.45;
}

.ai-plan-confirm-actions {
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.ai-plan-conflicts-lead {
  margin: 0.25rem 0 0;
  font-weight: 600;
  line-height: 1.4;
}

.ai-plan-history,
.ai-chef-history {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(154, 52, 18, 0.14);
}

.ai-plan-history-head,
.ai-chef-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.ai-plan-history-title,
.ai-chef-history-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--accent-deep, #9a3412);
}

.ai-plan-history-clear,
.ai-chef-history-clear {
  padding: 0;
  white-space: nowrap;
}

.ai-plan-history-list,
.ai-chef-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.ai-plan-history-item,
.ai-chef-history-item {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(28, 25, 23, 0.1);
  border-radius: 0.55rem;
  background: rgba(255, 252, 247, 0.92);
}

.ai-plan-history-meta,
.ai-chef-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  color: #78716c;
}

.ai-plan-history-prompt,
.ai-chef-history-prompt {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.ai-plan-history-refs,
.ai-chef-history-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: #44403c;
}

.ai-plan-history-actions,
.ai-chef-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ai-plan-conflicts-list {
  color: #9a3412;
}
