.pantry { max-width: 64rem; margin: 0 auto; overflow-wrap: anywhere; }
.pantry h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; }
.pantry h2 { font-size: 1.2rem; font-weight: 650; margin: 1rem 0 .5rem; }
.pantry h3 { font-weight: 650; }
.pantry p, .pantry li { margin: .4rem 0; }
.pantry a { color: #4338ca; text-decoration: underline; }
.pantry .card { border: 1px solid #cbd5e1; border-radius: .65rem; padding: 1rem; background: white; margin: 1rem 0; }
.pantry .muted { color: #475569; font-size: .9rem; }
.pantry .warning { background: #fffbeb; border: 1px solid #fcd34d; padding: .75rem; border-radius: .5rem; }
.pantry label { display: block; font-size: .9rem; font-weight: 550; margin: .6rem 0; }
.pantry input:not([type=checkbox]), .pantry select, .pantry textarea { display: block; width: 100%; border: 1px solid #94a3b8; border-radius: .4rem; padding: .6rem; background: white; color: #0f172a; }
.pantry input[type=checkbox] { margin-right: .4rem; width: 1.2rem; height: 1.2rem; vertical-align: middle; }
.pantry button, .pantry input[type=submit] { cursor: pointer; padding: .7rem 1rem; min-height: 44px; border-radius: .5rem; background: #4338ca; color: white; margin: .5rem .25rem .5rem 0; width: auto; }
.pantry button:disabled { background: #64748b; cursor: not-allowed; }
.pantry summary { cursor: pointer; padding: .75rem 0; font-weight: 600; }
.pantry .fields { display: grid; gap: .5rem 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.pantry img { max-width: 100%; max-height: 24rem; object-fit: contain; border-radius: .4rem; }
.pantry .badge { display: inline-block; border-radius: .5rem; padding: .2rem .5rem; background: #eef2ff; color: #3730a3; font-size: .85rem; }

/* Keep confident observations readable; editing stays optional. */
.pantry .batch-items { list-style: none; padding: 0; margin: 1rem 0; }
.pantry .batch-items li { display: flex; align-items: baseline; gap: .5rem 1.5rem; justify-content: space-between; padding: .85rem 0; margin: 0; }
.pantry .batch-items li + li { border-top: 1px solid #e2e8f0; }
.pantry .batch-product { flex: 1; min-width: 0; font-weight: 600; }
.pantry .batch-product .muted { display: block; font-weight: 400; }
.pantry .batch-quantity { flex: 0 1 40%; text-align: right; }
.pantry .batch-edit { border-top: 1px solid #e2e8f0; }
.pantry .batch-edit a, .pantry .batch-inventory-link { display: inline-block; min-height: 44px; padding: .6rem 0; }
.pantry summary { min-height: 44px; }
.pantry :is(a, summary, button, input, select, textarea):focus-visible { outline: 3px solid #4338ca; outline-offset: 3px; }
@media (max-width: 480px) {
  .pantry .batch-items li { flex-direction: column; gap: .2rem; }
  .pantry .batch-quantity { text-align: left; }
}

/* Current inventory follows the owner's slate/indigo cards and keeps quantities aligned. */
.pantry-inventory { max-width: 56rem; color: #0f172a; }
.pantry-inventory .inventory-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.pantry-inventory .inventory-header h1 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.025em; margin: 0; }
.pantry-inventory .inventory-header p { color: #64748b; font-size: .9rem; margin: .4rem 0 0; }
.pantry-inventory .inventory-add { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; flex-shrink: 0; min-height: 44px; padding: .65rem 1rem; border-radius: .6rem; background: #fff; color: #4338ca; border: 1px solid #cbd5e1; text-decoration: none; font-size: .875rem; font-weight: 600; box-shadow: 0 1px 2px #0f172a0d; }
.pantry-inventory .inventory-add:hover { background: #eef2ff; }
.pantry-inventory .inventory-add span { font-size: 1.25rem; line-height: 1; }
.pantry-inventory .inventory-panel { border: 1px solid #e2e8f0; border-radius: .85rem; background: #fff; box-shadow: 0 1px 2px #0f172a05; }
.pantry-inventory .inventory-search { display: grid; grid-template-columns: minmax(0, 1fr) 10rem auto; gap: .75rem; align-items: end; padding: 1rem 1.25rem; }
.pantry-inventory .inventory-search label { margin: 0 0 .4rem; font-size: .8rem; color: #475569; font-weight: 600; }
.pantry-inventory .inventory-search input, .pantry-inventory .inventory-search select { min-height: 44px; margin: 0; font-size: 1rem; border-color: #cbd5e1; border-radius: .5rem; }
.pantry-inventory .inventory-search input[type=submit] { background: #4f46e5; color: #fff; border-color: #4f46e5; font-weight: 600; padding-inline: 1.25rem; }
.pantry-inventory .inventory-search-input { position: relative; }
.pantry-inventory .inventory-search-input svg { position: absolute; width: 1.15rem; height: 1.15rem; left: .75rem; top: .8rem; color: #64748b; pointer-events: none; }
.pantry-inventory .inventory-search-input input { padding-left: 2.4rem; }
.pantry-inventory .inventory-results-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; font-size: .875rem; color: #64748b; }
.pantry-inventory .inventory-results-header strong { color: #475569; font-weight: 500; }
.pantry-inventory .inventory-action { min-height: 44px; }
.pantry-inventory .inventory-results-header a { font-size: .875rem; }
.pantry-inventory .inventory-group { margin-bottom: 1.25rem; }
.pantry-inventory .inventory-group-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0; }
.pantry-inventory .inventory-group-header h2 { font-size: 1rem; margin: 0; }
.pantry-inventory .inventory-group-header > span { color: #64748b; font-size: .8rem; }
.pantry-inventory .inventory-column-headings, .pantry-inventory .inventory-row { display: grid; grid-template-columns: minmax(0, 1fr) 9rem 8rem; gap: .35rem 1.25rem; align-items: center; padding: .75rem 1.25rem; }
.pantry-inventory .inventory-column-headings { padding-block: .6rem; background: #f8fafc; font-size: .75rem; color: #64748b; }
.pantry-inventory .inventory-column-headings span:nth-child(2) { text-align: right; }
.pantry-inventory .inventory-row { border-bottom: 0; }
.pantry-inventory .inventory-row + .inventory-row { border-top: 1px solid #f1f5f9; }
.pantry-inventory .inventory-product { min-width: 0; }
.pantry-inventory .inventory-row h3 { font-size: .925rem; line-height: 1.5; font-weight: 600; }
.pantry-inventory .inventory-product a { color: #1e293b; text-decoration: none; min-width: 44px; padding: .35rem 0; display: flex; align-items: center; }
.pantry-inventory .inventory-product a:hover { color: #4338ca; text-decoration: underline; }
.pantry-inventory .inventory-size { font-size: .8rem; color: #64748b; margin: -.15rem 0 .25rem; }
.pantry-inventory .inventory-count { text-align: right; }
.pantry-inventory .inventory-quantity { font-size: .925rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pantry-inventory .inventory-unavailable { display: block; font-size: .75rem; color: #64748b; margin-top: .2rem; }
.pantry-inventory .inventory-age { justify-self: start; font-size: .75rem; line-height: 1.4; padding: .3rem .55rem; border-radius: 2rem; }
.pantry-inventory .inventory-age-key { color: #64748b; font-size: .8rem; margin: -.25rem 0 1.25rem; }
.pantry-inventory .inventory-age-key summary { font-weight: 400; }
.pantry-inventory .inventory-age-key p { max-width: 40rem; line-height: 1.6; }
.pantry-inventory .inventory-tools { margin-top: 1.5rem; font-size: .875rem; }
.pantry-inventory .inventory-tools > summary { padding: 1rem 1.25rem; color: #475569; }
.pantry-inventory .inventory-tools-body { border-top: 1px solid #e2e8f0; padding: .5rem 1.25rem 1.25rem; }
.pantry-inventory .inventory-empty { text-align: center; padding: 2.5rem 1.25rem; }
.pantry-inventory .inventory-empty > svg { width: 2rem; height: 2rem; color: #94a3b8; margin: 0 auto 1rem; }
.pantry-inventory .inventory-empty h2 { font-size: 1rem; margin: 0 0 .5rem; }
.pantry-inventory .inventory-empty p { color: #64748b; font-size: .875rem; }
.pantry-inventory .inventory-empty .muted { font-size: .75rem; margin-top: .75rem; }
@media (max-width: 639px) {
  .pantry-inventory .inventory-header { align-items: flex-start; flex-wrap: wrap; margin-bottom: 1.25rem; }
  .pantry-inventory .inventory-header p { max-width: 18rem; }
  .pantry-inventory .inventory-header > div { flex: 1 1 11rem; }
  .pantry-inventory .inventory-add { font-size: .8rem; padding-inline: .75rem; }
  .pantry-inventory .inventory-search { grid-template-columns: minmax(0, 1fr) auto; padding: 1rem; }
  .pantry-inventory .inventory-search-field { grid-column: 1 / -1; }
  .pantry-inventory .inventory-column-headings { display: none; }
  .pantry-inventory .inventory-group-header { padding: .85rem 1rem; }
  .pantry-inventory .inventory-row { grid-template-columns: minmax(0, 1fr) minmax(5rem, 7rem); padding: .75rem 1rem; gap: .25rem .75rem; }
  .pantry-inventory .inventory-product { grid-row: 1 / 3; }
  .pantry-inventory .inventory-count { align-self: end; grid-column: 2; }
  .pantry-inventory .inventory-age { grid-column: 2; justify-self: end; align-self: start; }
  .pantry-inventory .inventory-quantity { font-size: .875rem; }
}
.pantry-inventory .inventory-age { background: #f1f5f9; color: #475569; }
.pantry-inventory .inventory-age.age-green { background: #dcfce7; color: #166534; }
.pantry-inventory .inventory-age.age-yellow { background: #fef9c3; color: #854d0e; }
.pantry-inventory .inventory-age.age-red { background: #fee2e2; color: #991b1b; }
.pantry-inventory .inventory-tools button { max-width: 100%; white-space: normal; }
