.ingredients-page main{max-width:1200px;padding:32px 24px;margin:auto}
.ingredients-page .intro{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}
.ingredients-page .intro>div{min-width:0;max-width:720px}
.ingredients-page #add-category{flex-shrink:0;margin-top:6px;min-height:44px}
.ingredients-page .library-controls{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:16px;margin:8px 0 0}
.ingredients-page .library-controls>label{margin:0;min-width:0}
.ingredients-page .library-controls .search{min-width:0;margin:0;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:0 14px}
.ingredients-page .search input{padding:14px 0;margin:0;width:100%;min-width:0;font-size:14px}
.ingredients-page .category-control{display:flex;align-items:center;gap:8px}
.ingredients-page .category-control select{max-width:210px;min-height:44px;color:var(--ink);background:var(--surface)}
.ingredients-page .default-filter{display:flex;align-items:center;gap:8px;min-height:44px;white-space:nowrap}
.ingredients-page .default-filter input{width:18px;height:18px;margin:0}
.ingredients-page #library-status{margin:12px 0;min-height:20px}
.ingredients-page .product-group{margin:20px 0 30px}
.ingredients-page .product-group .section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;flex-wrap:wrap}
.ingredients-page .category-toggle{display:flex;align-items:center;gap:8px;padding:4px 0;border:0;background:transparent;min-height:44px;color:var(--ink);text-align:left;font-size:20px;font-weight:700}
.ingredients-page .category-toggle h2{font-size:20px;margin:0}
.ingredients-page .category-chevron{width:18px;height:18px;transition:transform .15s}
.ingredients-page .category-toggle[aria-expanded=false] .category-chevron{transform:rotate(-90deg)}
.ingredients-page .category-count{font-size:12px;color:var(--muted);font-weight:400}.ingredients-page .category-name{min-width:0;overflow-wrap:anywhere}
.ingredients-page .add-category-product{font-size:13px;padding:10px 4px;min-height:44px}
.ingredients-page .product-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;background:transparent;border:0;border-radius:0}
.ingredients-page .product-grid[hidden]{display:none}
.ingredients-page .library-product{display:flex;flex-direction:column;align-items:stretch;position:relative;gap:0;min-width:0;padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--surface);content-visibility:auto;contain-intrinsic-size:auto 270px}
.ingredients-page .section-title>h2{margin:0}
.ingredients-page .library-product:last-child{border-bottom:1px solid var(--line)}
.ingredients-page .library-product.default-product{background:var(--surface);border-color:var(--accent)}
.ingredients-page .product-name{min-height:70px;padding-right:32px}
.ingredients-page .product-name h3{font-size:16px;line-height:1.4;gap:12px;align-items:center;overflow-wrap:anywhere}
.ingredients-page .product-name .food-miniature{width:52px;height:52px;flex-basis:52px}
.ingredients-page .product-name-text{min-width:0}
.ingredients-page .product-choice{display:block;font-size:12px;font-weight:400;color:var(--muted);margin-top:4px}
.ingredients-page .default-product .product-choice{color:var(--accent);font-weight:600}
.ingredients-page .default-toggle{position:absolute;right:9px;top:10px;grid-column:auto;grid-row:auto;width:44px;height:44px;min-height:44px;padding:0;font-size:25px;background:transparent;border:0;color:var(--muted)}
.ingredients-page .default-toggle[aria-pressed=true]{color:#946006}
.ingredients-page .product-nutrition-summary{padding:0;margin-top:12px;grid-column:auto;grid-row:auto}
.ingredients-page .product-nutrition-summary>p{font-size:12px;margin-bottom:8px;color:var(--muted)}
.ingredients-page .product-macros{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;border-top:1px solid var(--line);padding-top:12px;font-variant-numeric:tabular-nums}
.ingredients-page .product-macros>span{min-width:0}
.ingredients-page .product-macros strong{display:block;font-size:16px;font-weight:700;color:var(--ink)}
.ingredients-page .product-macros small{display:block;font-size:11px;color:var(--muted);margin-top:3px}
.ingredients-page .product-salt{font-size:12px;color:var(--muted);margin:10px 0 0;min-height:18px}
.ingredients-page .product-actions{display:flex;grid-column:auto;grid-row:auto;gap:8px;margin-top:auto;padding:18px 0 0;flex-wrap:nowrap}
.ingredients-page .product-actions button{min-height:44px}
.ingredients-page .product-actions .product-eat-button{flex:1;padding:10px 8px;background:var(--soft);border:0;border-radius:9px;color:var(--accent);font-size:13px;font-weight:600}
.ingredients-page .product-actions .product-icon-action{width:44px;height:44px;flex:0 0 44px;display:grid;place-items:center;padding:0;border:1px solid var(--line);border-radius:9px;background:var(--surface)}
.ingredients-page .product-icon-action svg{width:18px;height:18px}
.ingredients-page .product-actions:empty{display:none}
.ingredients-page .empty-category{grid-column:1/-1;margin:0;padding:20px 0;color:var(--muted)}
@media(max-width:950px){.ingredients-page .product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ingredients-page .library-controls{grid-template-columns:minmax(0,1fr) auto}.ingredients-page .library-controls .search{grid-column:1/-1}}
@media(max-width:600px){.ingredients-page main{padding:24px 16px}.ingredients-page .intro{flex-wrap:wrap;gap:4px;margin-bottom:16px}.ingredients-page #add-category{margin:0}.ingredients-page .library-controls{gap:12px}.ingredients-page .category-control{display:block}.ingredients-page .category-control select{display:block;width:100%;max-width:100%;margin-top:5px}.ingredients-page .product-grid{grid-template-columns:1fr;gap:12px}.ingredients-page .library-product{padding:16px}.ingredients-page .product-name{min-height:62px}.ingredients-page .product-name h3{font-size:16px}.ingredients-page .default-toggle{grid-column:auto;grid-row:auto}.ingredients-page .product-nutrition-summary{grid-column:auto;grid-row:auto;padding:0}.ingredients-page .product-actions{grid-column:auto;grid-row:auto;padding:16px 0 0}.ingredients-page .product-group .section-title{gap:8px}.ingredients-page .add-category-product{font-size:12px;padding:10px 0}.ingredients-page .category-toggle h2{font-size:19px}}
@media(max-width:374px){.ingredients-page main{padding:20px 12px}.ingredients-page .library-controls{gap:8px}.ingredients-page .default-filter{font-size:11px}.ingredients-page .category-toggle h2{font-size:17px}.ingredients-page .library-product{padding:14px}.ingredients-page .product-name .food-miniature{width:46px;height:46px;flex-basis:46px}.ingredients-page .product-macros strong{font-size:15px}}
@media(prefers-reduced-motion:reduce){.ingredients-page .category-chevron{transition:none}}

/* Keep nutrition fields aligned independently of global label margins. */
#new-product-form .product-nutrition{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px;align-items:end;margin:20px 0 0}
#new-product-form .product-nutrition>label{margin:0;min-width:0;display:flex;flex-direction:column;gap:8px;line-height:1.4}
#new-product-form .product-nutrition input{margin:0;width:100%;min-width:0;min-height:44px}
#new-product-form .product-calorie-field{grid-column:1/-1}
#new-product-form #new-salt-help{margin:10px 0 0;line-height:1.5}
#new-product-form .dialog-actions{margin-top:20px}
@media(max-width:600px){#new-product-dialog{padding:20px 16px}#new-product-form input,#new-product-form select{font-size:16px}#new-product-form .dialog-actions .primary{width:100%;min-height:44px}}
