/* ─────────────────────────────────────────────────────────────
   Pantry — picker, matching, shopping list, recipe badge
   ───────────────────────────────────────────────────────────── */

.prt-pantry-main { padding: 1.5rem; max-width: 1180px; margin: 0 auto; }

.prt-pantry-hero { padding-bottom: 1rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--prt-border); }
.prt-pantry-hero h1 { font-family: "Fraunces", serif; font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.1; margin: 0.3rem 0 0.25rem; }
.prt-pantry-hero__intro { font-size: 0.9rem; color: var(--prt-muted); max-width: 62ch; margin: 0; }
.prt-pantry-hero__notice { margin-top: 0.6rem; font-size: 0.82rem; color: var(--prt-muted); background: rgba(184,137,42,0.08); border-left: 3px solid var(--prt-gold); padding: 0.5rem 0.7rem; border-radius: 0 6px 6px 0; }

.prt-pantry { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 1.5rem; align-items: start; }
.prt-pantry__col { display: grid; gap: 0.7rem; min-width: 0; }
.prt-pantry__heading { font-family: "Fraunces", serif; font-size: 1.1rem; margin: 0; }
.prt-pantry__loading, .prt-pantry__muted { font-size: 0.84rem; color: var(--prt-muted); margin: 0; }

/* Search */
.prt-pantry__search { position: relative; }
.prt-pantry__search::before { content: "🔍"; position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); font-size: 0.9rem; opacity: 0.55; pointer-events: none; }
.prt-pantry__search-input { width: 100%; height: 42px; border: 1px solid var(--prt-border); border-radius: 999px; padding: 0 1rem 0 2.5rem; background: #fff; font-family: inherit; font-size: 0.88rem; color: var(--prt-text); }

/* Cards */
.prt-pantry__card { background: var(--prt-paper); border: 1px solid var(--prt-border); border-radius: 12px; box-shadow: var(--prt-shadow); overflow: hidden; }
.prt-pantry__card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--prt-border); flex-wrap: wrap; }
.prt-pantry__card-title { font-family: "Fraunces", serif; font-size: 1rem; margin: 0; }
.prt-pantry__count { color: var(--prt-accent); }
.prt-pantry__card-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.prt-pantry__card-body { padding: 0.8rem 0.9rem; }

/* Both scrollable lists get the same cap so neither can push the page */
.prt-pantry__tray-body,
.prt-pantry__cat-body { max-height: 260px; overflow-y: auto; }

.prt-pantry__results { padding: 0.7rem 0.9rem; }

.prt-pantry__pill { background: none; border: 1px solid var(--prt-border); border-radius: 999px; padding: 0.22rem 0.6rem; font-size: 0.72rem; color: var(--prt-muted); cursor: pointer; font-family: inherit; min-height: 0; }
.prt-pantry__pill:hover { background: rgba(24,22,15,0.05); }
.prt-pantry__pill.is-warn { background: rgba(184,137,42,0.1); border-color: rgba(184,137,42,0.28); color: var(--prt-gold); font-weight: 600; }

.prt-pantry__status { font-size: 0.72rem; color: var(--prt-muted); }
.prt-pantry__status.is-ok { color: var(--prt-green); }
.prt-pantry__status.is-error { color: var(--prt-accent); }

.prt-pantry__allergens { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.6rem 0.9rem; background: rgba(184,137,42,0.06); border-bottom: 1px solid var(--prt-border); }
.prt-pantry__allergen { background: #fff; border: 1px solid rgba(184,137,42,0.3); border-radius: 999px; padding: 0.18rem 0.55rem; font-size: 0.72rem; color: var(--prt-gold); font-weight: 600; }

.prt-pantry__login-note { padding: 0 0.9rem 0.8rem; font-size: 0.78rem; }

/* Ingredient chips */
.prt-chip-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.prt-ing-chip { display: inline-flex; align-items: center; gap: 0.3rem; background: #fff; color: var(--prt-text); border: 1px solid var(--prt-border); border-radius: 999px; padding: 0.3rem 0.7rem; font-size: 0.8rem; cursor: pointer; font-family: inherit; text-align: left; transition: background 0.12s, border-color 0.12s; min-height: 0; }
.prt-ing-chip:hover { border-color: var(--prt-accent); }
.prt-ing-chip.is-on { background: var(--prt-accent); border-color: var(--prt-accent); color: #fff; font-weight: 600; }
.prt-ing-chip__tick { font-size: 0.7rem; }
.prt-ing-chip__fresh { font-size: 0.62rem; opacity: 0.5; }

/* Category tabs */
.prt-pantry__cats { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--prt-border); }
.prt-pantry__cat { display: inline-flex; align-items: center; gap: 0.3rem; background: transparent; color: var(--prt-text); border: 1px solid var(--prt-border); border-radius: 999px; padding: 0.28rem 0.65rem; font-size: 0.78rem; cursor: pointer; font-family: inherit; min-height: 0; }
.prt-pantry__cat.is-on { background: var(--prt-dark); border-color: var(--prt-dark); color: #faf5e8; font-weight: 600; }
.prt-pantry__cat-count { background: var(--prt-accent); color: #fff; border-radius: 999px; padding: 0 0.32rem; font-size: 0.66rem; font-weight: 700; }
.prt-pantry__cat.is-on .prt-pantry__cat-count { background: rgba(250,245,232,0.22); }

.prt-pantry__cat-actions { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--prt-border); background: rgba(24,22,15,0.02); flex-wrap: wrap; }
.prt-pantry__cat-all { background: #fff; color: var(--prt-text); border: 1px solid var(--prt-border); border-radius: 999px; padding: 0.24rem 0.7rem; font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit; min-height: 0; }
.prt-pantry__cat-all.is-on { background: var(--prt-accent); border-color: var(--prt-accent); color: #fff; }
.prt-pantry__cat-note { font-size: 0.72rem; color: var(--prt-muted); }

/* Mode tabs */
.prt-pantry__modes { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.prt-pantry__mode { background: #fff; color: var(--prt-text); border: 1px solid var(--prt-border); border-radius: 999px; padding: 0.32rem 0.8rem; font-size: 0.8rem; cursor: pointer; font-family: inherit; min-height: 0; }
.prt-pantry__mode.is-on { background: var(--prt-accent); border-color: var(--prt-accent); color: #fff; font-weight: 600; }

.prt-pantry__empty-box { font-size: 0.85rem; color: var(--prt-muted); background: #fff; border: 1px dashed var(--prt-border); border-radius: 10px; padding: 1rem; margin: 0; text-align: center; }
.prt-pantry__empty-box.is-ok { color: var(--prt-green); background: rgba(58,90,60,0.07); border-style: solid; border-color: rgba(58,90,60,0.22); }

/* Match cards */
.prt-match-list { display: grid; gap: 0.5rem; }
.prt-match { background: var(--prt-paper); border: 1px solid var(--prt-border); border-radius: 10px; overflow: hidden; }
.prt-match.is-cookable { border-color: var(--prt-green); }
.prt-match__head { padding: 0.7rem 0.9rem; cursor: pointer; display: grid; gap: 0.4rem; }
.prt-match__title-row { display: flex; align-items: baseline; gap: 0.5rem; }
.prt-match__title { font-family: "Fraunces", serif; font-size: 0.95rem; margin: 0; flex: 1; font-weight: 600; }
.prt-match__badge { background: rgba(58,90,60,0.1); color: var(--prt-green); border-radius: 999px; padding: 0.12rem 0.5rem; font-size: 0.68rem; font-weight: 700; white-space: nowrap; }
.prt-match__pct { font-family: "DM Mono", monospace; font-size: 0.85rem; color: var(--prt-muted); }
.prt-match__pct.is-full { color: var(--prt-green); }
.prt-match__pct.is-mid { color: var(--prt-gold); }
.prt-match__bar-row { display: flex; align-items: center; gap: 0.6rem; }
.prt-match__bar { height: 5px; background: rgba(24,22,15,0.08); border-radius: 999px; overflow: hidden; flex: 1; min-width: 60px; }
.prt-match__bar-fill { height: 100%; border-radius: 999px; background: var(--prt-accent); transition: width 0.3s; }
.prt-match__bar-fill.is-full { background: var(--prt-green); }
.prt-match__bar-fill.is-mid { background: var(--prt-gold); }
.prt-match__meta { font-size: 0.72rem; color: var(--prt-muted); white-space: nowrap; }
.prt-match__missing-line { margin: 0; font-size: 0.76rem; color: var(--prt-muted); }
.prt-match__body { padding: 0 0.9rem 0.85rem; display: grid; gap: 0.5rem; }
.prt-match__label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; margin: 0.2rem 0 0; }
.prt-match__label.is-have { color: var(--prt-green); }
.prt-match__label.is-buy { color: var(--prt-accent); }
.prt-match__cta { justify-self: start; margin-top: 0.3rem; }

.prt-line-chip { border-radius: 999px; padding: 0.16rem 0.5rem; font-size: 0.74rem; }
.prt-line-chip.is-have { background: rgba(58,90,60,0.09); color: var(--prt-green); }
.prt-line-chip.is-buy { background: rgba(201,74,56,0.08); color: var(--prt-accent); }

/* Shopping list */
.prt-shopping { background: var(--prt-paper); border: 1px solid var(--prt-border); border-radius: 10px; overflow: hidden; }
.prt-shopping__row { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.55rem 0.9rem; border-top: 1px solid var(--prt-border); }
.prt-shopping__row:first-child { border-top: none; }
.prt-shopping__check { width: 15px; height: 15px; flex-shrink: 0; margin-top: 0.2rem; accent-color: var(--prt-accent); }
.prt-shopping__text { flex: 1; min-width: 0; }
.prt-shopping__name { font-size: 0.87rem; font-weight: 600; }
.prt-shopping__unit { font-size: 0.72rem; color: var(--prt-muted); margin-left: 0.4rem; }
.prt-shopping__recipes { margin: 0.1rem 0 0; font-size: 0.72rem; color: var(--prt-muted); }
.prt-shopping__times { background: rgba(184,137,42,0.12); color: var(--prt-gold); border-radius: 999px; padding: 0.1rem 0.45rem; font-size: 0.68rem; font-weight: 700; }

/* Single-recipe badge */
.prt-pantry-badge { display: grid; gap: 0.45rem; background: var(--prt-paper); border: 1px solid var(--prt-border); border-radius: 10px; padding: 0.7rem 0.9rem; margin-bottom: 0.9rem; }
.prt-pantry-badge.is-cookable { border-color: var(--prt-green); background: rgba(58,90,60,0.06); }
.prt-pantry-badge__text { font-size: 0.85rem; }
.prt-pantry-badge.is-cookable .prt-pantry-badge__text { color: var(--prt-green); }
.prt-pantry-badge__link { font-size: 0.83rem; font-weight: 600; color: var(--prt-accent); }

/* Mobile */
@media (max-width: 980px) {
  .prt-pantry { grid-template-columns: 1fr; }
  .prt-pantry-main { padding: 1rem; }
  .prt-pantry__tray-body, .prt-pantry__cat-body { max-height: 220px; }
}
