/* ── PANTRY ──────────────────────────────────── */

.pantry {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ───────────────────────────────────── */

.pantry__header {
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: 52px var(--screen-padding) 16px;
  flex-shrink: 0;
}

.pantry__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.pantry__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  letter-spacing: var(--ls-tight);
  line-height: 1;
}

.pantry__subtitle {
  font-size: var(--text-body-sm);
  color: var(--color-text-subtle);
  margin-top: 3px;
}

.pantry__header-count {
  font-size: var(--text-body-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-subtle);
}

.pantry__header-actions {
  display: flex;
  gap: var(--space-2);
}

.pantry__header-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pantry__header-btn--muted   { background: var(--color-bg-muted); }
.pantry__header-btn--primary { background: var(--color-brand-primary); }

.pantry__back-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-brand-primary);
  display: flex;
  align-items: center;
  padding: 0;
  flex-shrink: 0;
}

/* ── Body ─────────────────────────────────────── */

.pantry__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--screen-padding) 0;
}

/* ── Summary card ─────────────────────────────── */

.pantry__summary-card {
  background: linear-gradient(135deg, #2a4030 0%, #3d5a40 100%);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: var(--space-4);
  position: relative;
  overflow: hidden;
}

.pantry__summary-bubble {
  position: absolute;
  border-radius: var(--radius-circle);
}

.pantry__summary-bubble--tl {
  width: 140px;
  height: 140px;
  top: -28px;
  right: -28px;
  background: rgba(255, 255, 255, 0.06);
}

.pantry__summary-bubble--br {
  width: 88px;
  height: 88px;
  bottom: -36px;
  right: 36px;
  background: rgba(255, 255, 255, 0.04);
}

.pantry__summary-label {
  font-size: 11px;
  font-weight: var(--fw-medium);
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 18px;
  position: relative;
}

.pantry__summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
  position: relative;
}

.pantry__summary-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pantry__summary-val {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: var(--fw-bold);
  color: #fff;
  line-height: 1;
}

.pantry__summary-key {
  font-size: 11px;
  font-weight: var(--fw-medium);
  color: rgba(255, 255, 255, 0.6);
}

.pantry__summary-btn {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: var(--text-label-md);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  position: relative;
  transition: background var(--duration-fast) var(--ease-standard);
}

.pantry__summary-btn:active {
  background: rgba(255, 255, 255, 0.28);
}

/* ── AI insight card ──────────────────────────── */

.pantry__ai-card {
  background: #fdfbea;
  border: 1.5px solid #e6d472;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: var(--space-4);
}

.pantry__ai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.pantry__ai-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #d4a830, #b8860b);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pantry__ai-label {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: #8a6800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pantry__ai-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  line-height: 1.4;
  margin-bottom: 10px;
}

.pantry__ai-body {
  font-size: var(--text-body-sm);
  color: var(--color-text-subtle);
  line-height: 1.6;
}

/* ── Quick access grid ────────────────────────── */

.pantry__quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: var(--space-5);
}

.pantry__quick-btn {
  background: var(--color-bg-elevated);
  border-radius: 16px;
  padding: 16px;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  font-size: var(--text-label-md);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  transition: transform var(--duration-fast) var(--ease-standard);
}

.pantry__quick-btn:active { transform: scale(0.97); }

.pantry__quick-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pantry__quick-icon--green      { background: #e8f0e9; }
.pantry__quick-icon--terracotta { background: #fdf3ee; }
.pantry__quick-icon--gold       { background: #fdf8e8; }
.pantry__quick-icon--muted      { background: var(--color-bg-muted); }

/* ── Section title ────────────────────────────── */

.pantry__section-title {
  font-family: var(--font-display);
  font-size: var(--text-heading-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  margin-bottom: 14px;
}

/* ── Category grid ────────────────────────────── */

.pantry__cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: var(--space-5);
}

.pantry__cat-card {
  background: var(--color-bg-elevated);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-standard);
}

.pantry__cat-card:active { transform: scale(0.97); }

.pantry__cat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.pantry__cat-name {
  font-size: var(--text-label-md);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  margin-bottom: 3px;
}

.pantry__cat-count {
  font-size: 11px;
  color: var(--color-text-subtle);
  margin-bottom: 10px;
}

.pantry__cat-bar {
  height: 3px;
  background: var(--color-border-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.pantry__cat-bar-fill {
  height: 100%;
  border-radius: 999px;
}

/* ── Recent scroll ────────────────────────────── */

.pantry__recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.pantry__recent-header .pantry__section-title { margin-bottom: 0; }

.pantry__link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-label-md);
  font-weight: var(--fw-medium);
  color: var(--color-brand-primary);
}

.pantry__recent-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin-inline: calc(-1 * var(--screen-padding));
  padding-inline: var(--screen-padding);
  padding-bottom: var(--space-2);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.pantry__recent-scroll::-webkit-scrollbar { display: none; }

.pantry__recent-card {
  flex-shrink: 0;
  width: 130px;
  background: var(--color-bg-elevated);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.pantry__recent-img {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pantry__recent-initial {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: var(--fw-bold);
  color: rgba(255, 255, 255, 0.8);
  line-height: 1;
}

.pantry__recent-body { padding: 10px; }

.pantry__recent-name {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  margin-bottom: 4px;
  text-transform: capitalize;
  line-height: 1.3;
}

.pantry__fresh-badge {
  font-size: 10px;
  font-weight: var(--fw-semibold);
  padding: 2px 7px;
  border-radius: 999px;
}

.pantry__fresh-badge--ok   { color: #3d5a40; background: #e8f0e9; }
.pantry__fresh-badge--warn { color: #c96f4a; background: #fdf3ee; }

/* ── Inventory groups ─────────────────────────── */

.pantry__group { margin-bottom: 24px; }

.pantry__group-label {
  font-size: var(--text-label-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin-bottom: 10px;
}

.pantry__group-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pantry__item {
  background: var(--color-bg-elevated);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.pantry__item-info {
  flex: 1;
  min-width: 0;
}

.pantry__item-name {
  font-size: var(--text-body-md);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
}

.pantry__item-qty {
  font-size: var(--text-body-sm);
  font-weight: var(--fw-medium);
  color: #c96f4a;
  margin-top: 2px;
}

.pantry__item-stepper {
  display: flex;
  align-items: center;
  background: var(--color-bg-muted);
  border-radius: 10px;
  padding: 2px;
}

.pantry__stepper-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: var(--fw-semibold);
  color: var(--color-brand-primary);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-standard);
}

.pantry__stepper-btn:active { background: rgba(0, 0, 0, 0.06); }

.pantry__item-action {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-standard);
}

.pantry__item-action:active      { transform: scale(0.92); }
.pantry__item-action--muted      { background: var(--color-bg-muted); }
.pantry__item-action--danger     { background: #fdf3ee; }

/* ── Empty state ──────────────────────────────── */

.pantry__empty {
  text-align: center;
  padding: 60px 20px;
}

.pantry__empty-icon {
  width: 64px;
  height: 64px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.pantry__empty-title {
  font-family: var(--font-display);
  font-size: var(--text-heading-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.pantry__empty-body {
  font-size: var(--text-body-md);
  color: var(--color-text-subtle);
  line-height: 1.6;
}

/* ── Bottom space ─────────────────────────────── */

.pantry__bottom-space {
  height: calc(var(--nav-h) + var(--space-4));
}

/* ── Ingredient Detail ────────────────────────── */

.screen--full {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.pantry__detail-hero {
  height: 180px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px var(--screen-padding);
}

.pantry__detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,.45) 100%);
}

.pantry__detail-back {
  position: absolute;
  top: 52px;
  left: var(--screen-padding);
  background: rgba(255,255,255,.18);
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  z-index: 1;
}

.pantry__detail-hero-text {
  position: relative;
}

.pantry__detail-cat {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.72);
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-bottom: 4px;
}

.pantry__detail-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: var(--fw-bold);
  color: #fff;
  line-height: 1.1;
  text-transform: capitalize;
}

.pantry__body--detail {
  padding: var(--space-4) var(--screen-padding) calc(var(--nav-h) + var(--space-4));
}

.pantry__card {
  background: var(--color-bg-elevated);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.pantry__card-label {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.pantry__detail-stat {
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
}

.pantry__detail-stat-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: var(--fw-bold);
  line-height: 1.1;
  margin-bottom: 4px;
}

.pantry__detail-stat-label {
  font-size: 11px;
  color: var(--color-text-subtle);
}

.pantry__recipe-chip {
  background: var(--color-bg-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.pantry__detail-btn {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  font-size: var(--text-label-md);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  border: none;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.pantry__detail-btn:active { opacity: .8; }

.pantry__detail-btn--primary {
  background: var(--color-brand-primary);
  color: #fff;
}

.pantry__detail-btn--outline {
  background: transparent;
  border: 1.5px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
}

/* ── Expiration view ──────────────────────────── */

.pantry__exp-group { margin-bottom: 20px; }

.pantry__exp-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.pantry__exp-chip {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  padding: 4px 12px;
  border-radius: 999px;
  flex-shrink: 0;
}

.pantry__exp-item {
  background: var(--color-bg-elevated);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.pantry__exp-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pantry__exp-badge {
  padding: 8px 12px;
  border-radius: 12px;
  text-align: center;
  flex-shrink: 0;
  min-width: 52px;
}

.pantry__exp-hint {
  background: var(--color-bg-muted);
  border-radius: 10px;
  padding: 10px 12px;
}

.pantry__exp-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  border: none;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.pantry__exp-btn:active { opacity: .8; }

.pantry__exp-btn--primary {
  background: var(--color-brand-primary);
  color: #fff;
}

.pantry__exp-btn--muted {
  background: var(--color-bg-muted);
  color: var(--color-text-secondary);
}

/* ── Insights view ────────────────────────────── */

.pantry__insights-hero {
  background: linear-gradient(135deg, #2a4030 0%, #3d5a40 100%);
  border-radius: 24px;
  padding: 28px 24px 24px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.pantry__insights-pct {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
}

.pantry__insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.pantry__insights-stat {
  background: var(--color-bg-elevated);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.pantry__insights-stat-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--fw-bold);
  line-height: 1;
  margin-bottom: 4px;
}

/* ── AI assistant view ────────────────────────── */

.pantry__ai-assist-card {
  background: var(--color-bg-elevated);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.pantry__ai-assist-btn {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  font-size: var(--text-label-md);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  border: none;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.pantry__ai-assist-btn:active { opacity: .8; }

/* ── Qty overlay ──────────────────────────────── */

.pantry__qty-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.pantry__qty-backdrop {
  flex: 1;
  background: rgba(0,0,0,.4);
}

.pantry__qty-panel {
  background: var(--color-bg-elevated);
  border-radius: 20px 20px 0 0;
  padding: 12px var(--screen-padding) 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 80vh;
  overflow-y: auto;
  animation: pantry-panel-up 0.22s ease;
}

@keyframes pantry-panel-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.pantry__qty-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text-primary);
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 16px;
}

.pantry__qty-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  text-transform: capitalize;
  margin-bottom: 4px;
}

.pantry__qty-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 8px 0;
}

.pantry__qty-btn {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: none;
  background: var(--color-bg-muted);
  font-size: 24px;
  font-weight: 300;
  color: var(--color-brand-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-standard);
}

.pantry__qty-btn:active { background: #d8e4d8; }

.pantry__qty-val-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 80px;
  justify-content: center;
}

.pantry__qty-val {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: var(--fw-bold);
  color: var(--color-text-primary);
  line-height: 1;
}

.pantry__qty-unit {
  font-size: 16px;
  color: var(--color-text-subtle);
}

.pantry__qty-save {
  width: 100%;
  padding: 16px;
  background: var(--color-brand-primary);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: var(--text-label-lg);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.pantry__qty-save:active { opacity: .85; }

.pantry__qty-cancel-btn {
  background: none;
  border: none;
  font-size: var(--text-label-md);
  color: var(--color-text-subtle);
  cursor: pointer;
  padding: 4px;
}

/* ── Item edit overlay ────────────────────────── */

.pantry__item-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: all;
}

.pantry__item-edit-overlay .pantry__qty-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 40;
  flex: unset;
}

.pantry__item-edit-overlay .pantry__qty-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--phone-max-width);
  z-index: 41;
  display: block;
  animation: panel-slide-up 0.22s ease;
}

.pantry__edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.pantry__qty-panel .pantry__edit-row {
  margin-bottom: 14px;
}

.pantry__edit-field--half {
  flex: 1;
}

.pantry__edit-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.pantry__edit-row .pantry__edit-field {
  margin-bottom: 0;
}

.pantry__edit-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pantry__edit-input {
  width: 100%;
  background: var(--color-bg-surface);
  border: 1.5px solid var(--color-border-subtle);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--color-text-primary);
  outline: none;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.pantry__edit-input:focus {
  border-color: var(--color-brand-primary);
}

select.pantry__edit-input {
  cursor: pointer;
}

.pantry__add-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border-subtle);
  margin: 0 auto 20px;
}

.pantry__edit-hint {
  font-size: 11px;
  color: var(--color-text-subtle);
  margin-top: 2px;
}

.pantry__edit-field {
  margin-bottom: 0;
}

.pantry__add-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.pantry__add-cancel {
  flex: 1;
  padding: 15px;
  border-radius: 14px;
  border: 1.5px solid var(--color-border-subtle);
  background: var(--color-bg-surface);
  font-size: var(--text-body-md);
  font-weight: var(--fw-semibold);
  font-family: var(--font-body);
  color: var(--color-text-subtle);
  cursor: pointer;
}

.pantry__add-save {
  flex: 1;
  padding: 15px;
  border-radius: 14px;
  border: none;
  background: var(--color-brand-primary);
  font-size: var(--text-body-md);
  font-weight: var(--fw-semibold);
  font-family: var(--font-body);
  color: #fff;
  cursor: pointer;
}

/* ── Pantry AI Chat ───────────────────────────── */

.pantry--ai-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pantry__ai-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.pantry__ai-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 14px;
  padding: 40px 24px;
  text-align: center;
  color: var(--color-text-subtle);
  font-size: var(--text-body-sm);
  line-height: 1.6;
}

.pantry__ai-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pantry__ai-msg--user {
  align-self: flex-end;
  background: var(--color-brand-primary);
  color: #fff;
  padding: 11px 15px;
  border-radius: 18px 18px 4px 18px;
  max-width: 80%;
  font-size: var(--text-body-sm);
  line-height: 1.5;
}

.pantry__ai-msg--ai {
  align-self: flex-start;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 90%;
}

.pantry__ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pantry__ai-bubble {
  background: var(--color-bg-elevated);
  padding: 11px 14px;
  border-radius: 4px 18px 18px 18px;
  font-size: var(--text-body-sm);
  line-height: 1.6;
  color: var(--color-text-primary);
  white-space: pre-wrap;
}

.pantry__ai-typing {
  background: var(--color-bg-elevated);
  padding: 14px 16px;
  border-radius: 4px 18px 18px 18px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pantry__ai-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-text-subtle);
  animation: pantryTyping 1.2s infinite ease-in-out;
}
.pantry__ai-typing span:nth-child(2) { animation-delay: .2s; }
.pantry__ai-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes pantryTyping {
  0%, 80%, 100% { transform: scale(1); opacity: .5; }
  40%           { transform: scale(1.4); opacity: 1; }
}

.pantry__ai-chips {
  padding: 0 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pantry__ai-chip {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle, #e8e2d8);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}
.pantry__ai-chip:active { background: var(--color-bg-muted); }

.pantry__ai-input-row {
  padding: 12px 16px 28px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--color-border-subtle, #e8e2d8);
}

.pantry__ai-input {
  flex: 1;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle, #e8e2d8);
  border-radius: 24px;
  padding: 12px 18px;
  font-size: var(--text-body-sm);
  color: var(--color-text-primary);
  outline: none;
}
.pantry__ai-input::placeholder { color: var(--color-text-subtle); }

.pantry__ai-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-brand-primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.pantry__ai-send:disabled { opacity: .5; }
