/* Shared Recipes-style launcher and native dialog across the three food pages. */
.pantry-agent-launch{width:52px;height:52px;flex-shrink:0;display:grid;place-items:center;padding:0;border:1px solid var(--control-border);border-radius:50%;background:#fff;cursor:pointer}
.pantry-agent-launch:hover{border-color:var(--ember-text)}
.pantry-agent-launch:focus-visible{outline:3px solid var(--focus-ring);outline-offset:2px}
.pantry-agent-launch img{width:40px;height:40px;object-fit:contain}
.pantry-agent-dialog:not([open]){display:none !important}
.pantry-agent-dialog{position:fixed;inset:auto;left:50%;top:var(--pantry-popup-top,5rem);transform:translateX(-50%);width:min(100% - 1rem,46rem);max-width:46rem;height:calc(var(--pantry-popup-height,100dvh) - .75rem);max-height:calc(100dvh - 1.5rem);padding:0;border:1px solid var(--border-subtle);border-radius:12px;background:#f8fafc;color:var(--text-primary);overflow:hidden;z-index:200}
.pantry-agent-dialog[open]{display:flex;flex-direction:column}
.pantry-agent-dialog::backdrop{background:rgba(35,35,71,.45)}
.pantry-agent-dialog .panel-chat{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;border:0;border-radius:0;box-shadow:none}
.pantry-agent-dialog .panel-header,.pantry-agent-dialog .chat-form{flex:0 0 auto}
.pantry-agent-dialog .panel-header{flex-wrap:wrap}
.pantry-agent-dialog .chat-thread{flex:1 1 0;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain}
.pantry-agent-dialog .chat-form{padding-bottom:max(.85rem,env(safe-area-inset-bottom))}
.page-agent-dialog .panel-header{align-items:flex-start}
.page-agent-dialog .chat-input{min-height:3.5rem;max-height:120px}
html:has(.pantry-popup-open),body.pantry-popup-open{overflow:hidden}
.add-meal-header .pantry-agent-launch{margin-left:auto}
.grocery-actions .pantry-agent-launch{align-self:center}
@media(max-width:768px){
  .pantry-agent-dialog{top:var(--pantry-popup-top,0);width:100%;border-radius:12px 12px 0 0;height:var(--pantry-popup-height,100dvh);max-height:none}
  body.pantry-popup-open:has(.pantry-agent-dialog textarea:focus) .app-header{display:none}
}
@media print{
  .pantry-agent-launch,.pantry-agent-dialog{display:none !important}
}