.recipe-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr));gap:1rem;align-items:start}
.recipe-card,.food-empty {background:#fffefa;border:1px solid #dbe3d7;border-radius:16px;overflow:hidden}
.recipe-card>img {width:100%;height:180px;object-fit:cover;display:block}
.recipe-card>div,.food-empty {padding:1.5rem}
.recipe-card h2,.food-empty h2 {font-size:1.4rem;margin:0 0 .65rem;overflow-wrap:anywhere}
.recipe-card p,.recipe-detail>p,.food-empty p {color:#526451;margin:.4rem 0 1rem}
.food-dialog {box-sizing:border-box;color:#253d30;background:#fffefa;border:1px solid #d5ded1;border-radius:18px;padding:0;width:min(580px,calc(100% - 24px));max-height:90vh;max-height:90dvh;overflow:auto;overscroll-behavior:contain;margin:auto;box-shadow:0 18px 70px #1d33232b;font:inherit}
.food-dialog::backdrop {background:#1b302367}
.food-dialog>header {display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.35rem;border-bottom:1px solid #dbe3d7;background:#f1f5ed}
.food-dialog h2 {font-size:1.45rem;line-height:1.24;margin:0;overflow-wrap:anywhere}
.food-close {color:inherit;border:0;border-radius:50%;background:transparent;font-size:1.8rem;cursor:pointer;min-height:44px;min-width:44px}
.food-form,.recipe-detail,.product-reader {padding:1.2rem 1.35rem}
.food-form,.product-reader {display:grid;gap:.9rem}
.food-form label,.product-reader>label {display:block;font-size:1rem;font-weight:650;color:#314734}
.food-form input,.food-form textarea,.food-form select,.food-search input {box-sizing:border-box;display:block;min-width:0;width:100%;padding:.7rem .75rem;margin-top:.35rem;font:inherit;font-size:1rem;color:#253d30;border:1px solid #b9c7b7;border-radius:8px;background:#fff}
.food-form textarea {resize:vertical}
.food-pair {display:grid;grid-template-columns:1fr 1fr;gap:.85rem}
.food-pair>* {min-width:0}
.food-status {color:#3c5841;line-height:1.4;margin:0;font-size:1rem}
.food-status:empty,#matches:empty {display:none}
.recipe-detail img {display:block;margin:auto;max-width:100%;max-height:55vh;object-fit:contain}
.recipe-detail h3 {font-size:1.13rem;margin:1.2rem 0 .45rem}
.recipe-detail ul,.recipe-detail ol {padding-left:1.5rem}
.recipe-detail li {font-size:1.05rem;line-height:1.65;overflow-wrap:anywhere}
.product-reader {border-bottom:1px solid #dbe3d7;background:#f7f8f2}
.product-reader>a {font-size:.88rem;color:#426448;text-decoration:underline}
.food-search,.photo-actions {display:flex;align-items:stretch;gap:.6rem;flex-wrap:wrap}
.food-search input {flex:1 1 150px;margin:0}
.photo-actions label,.food-match {position:relative;border:1px solid #c6d3c2;background:white;border-radius:8px;color:#324d38;font:inherit;font-weight:650;cursor:pointer;padding:.7rem .85rem}
.photo-actions input {position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.photo-actions label:focus-within {outline:2px solid #395d42}
.food-match {display:block;text-align:left;width:100%;margin:.25rem 0}
.label-preview {max-height:240px;max-width:100%;object-fit:contain;justify-self:center}
.product-result {padding:.85rem 1rem;background:#edf4e7;border-radius:8px;font-weight:650}
.meal-estimate {margin:.75rem 0;padding:1rem;background:#f3f6ef;color:#304735;border:1px solid #d5dfcf;border-radius:12px;text-align:left;font-size:1rem;overflow-wrap:anywhere}
.meal-estimate h4 {font-size:1.1rem;margin:0 0 .6rem}
.meal-estimate .estimate-line {display:flex;align-items:center;gap:.65rem;padding:.5rem 0;border-bottom:1px solid #dbe4d5;font-size:1rem}
.estimate-line span {flex:1;min-width:0}.estimate-line small {display:block;font-weight:400}
.meal-estimate .estimate-line input {width:1.15rem;height:1.15rem;flex:none;accent-color:#547752}
.meal-estimate .estimate-total {display:flex;justify-content:space-between;gap:.75rem;flex-wrap:wrap;margin:.75rem 0;font-size:1.12rem}
.meal-estimate small,.meal-estimate .estimate-pending {font-size:.94rem;color:#465a49}
.meal-estimate a {color:#355c43;text-decoration:underline}
.macro-values {display:grid;grid-template-columns:repeat(auto-fit,minmax(105px,1fr));gap:.5rem;margin:.65rem 0;font-size:.98rem;font-weight:400}
.macro-values>.macro-value {display:block;color:#38503d;line-height:1.45;border-left:2px solid #b6c8ab;padding-left:.55rem}
.macro-value>b {display:block;color:#21362b}
.macro-values.compact {display:flex;flex-wrap:wrap;gap:.2rem .8rem;margin:.25rem 0;font-size:.9rem}
.macro-values.compact>.macro-value {display:inline;flex:none;border:0;padding:0}
.compact .macro-value>b {display:inline;font-weight:600}
.label-data {border-block:1px solid #d7e0d1;padding:.8rem 0}
.label-data summary {cursor:pointer;font-weight:650}
.label-data[open]>label,.label-data[open]>.food-pair,.macro-entry {margin-top:.75rem}
.macro-entry {border:0;min-width:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(105px,1fr));gap:.55rem}
.macro-entry legend,.meal-input-hint {font-size:.95rem;color:#49604c;font-weight:400}
.meal-input-hint {display:block}
.ingredient-composer {min-width:0}
.ingredient-row {margin:0 0 1rem;padding:1rem;border:1px solid #d3ddce;border-radius:12px;background:#fbfcf8;min-width:0}
.ingredient-row legend {padding:0 .4rem;font-size:1.07rem;color:#35533d;font-weight:700}
.ingredient-search {position:relative}
.ingredient-row label {display:block;color:#334a38;font-size:1rem}
.ingredient-row input,.ingredient-row select {width:100%;min-width:0;box-sizing:border-box;font:inherit;font-size:1rem;background:white;border:1px solid #bac9b6;border-radius:7px;padding:.68rem;margin-top:.3rem;color:#273c2d}
.ingredient-results {max-height:15rem;overflow-y:auto;overscroll-behavior:contain;border:1px solid #b7c7b3;background:white;border-radius:8px;margin-top:.2rem}
.ingredient-results[hidden] {display:none}
.ingredient-results {position:absolute;top:100%;inset-inline:0;z-index:3;box-shadow:0 5px 12px #334a381a}
.ingredient-results button {display:flex;align-items:center;justify-content:space-between;gap:.7rem;width:100%;min-height:43px;padding:.55rem .8rem;text-align:left;font:inherit;font-size:1rem;color:#263e2b;background:white;border:0;border-bottom:1px solid #edf0e9;cursor:pointer}
.ingredient-results button:hover,.ingredient-results button[aria-selected=true] {background:#ebf3e6}
.ingredient-results small {color:#536453;font-size:.82rem;text-align:right}
.ingredient-controls:not(:empty) {margin-top:.8rem}
.ingredient-row label.quantity-choice, .product-fields label.quantity-choice {
  display:flex; align-items:center; gap:.6rem; min-height:44px; width:fit-content; cursor:pointer;
}
.ingredient-row .quantity-choice input, .product-fields .quantity-choice input {
  width:1.15rem; height:1.15rem; margin:0; padding:0; accent-color:#476b45; flex:none;
}
.ingredient-quantity {display:grid;grid-template-columns:1.2fr 1fr;gap:.7rem;margin:.6rem 0}
.ingredient-row-actions {margin-top:.65rem;display:flex;justify-content:space-between;gap:.6rem;flex-wrap:wrap}
.ingredient-row-actions button {min-height:36px;font-size:.95rem}
.ingredient-feedback {color:#365339}
.ingredient-composer [data-ingredient-total]:not(:empty) {margin-top:1rem}
.meal-description summary {font-size:1rem;color:#3d5d42;cursor:pointer;padding:.5rem 0}
.product-list {background:#f2f6ed;padding:.65rem 1rem;border-radius:10px;margin:.8rem 0;font-size:1rem;color:#304a34}
.product-list>div {display:flex;align-items:center;flex-wrap:wrap;gap:.5rem;padding:.55rem 0;border-bottom:1px solid #d4dfcf}
.product-list>div>span {margin-right:auto}
.product-list small {display:block;font-size:.9rem;color:#506351}
.product-list p {display:flex;flex-wrap:wrap;justify-content:space-between;gap:.5rem}
@media(max-width:480px){.food-form,.product-reader,.recipe-detail {padding:1rem}.photo-actions label {flex:1}.food-pair{gap:.6rem}.food-form .button {width:100%}}
.recipe-toolbar{display:grid;grid-template-columns:minmax(240px,1fr) minmax(210px,.45fr);gap:.8rem;margin:1rem 0 .2rem;padding:1rem;background:#f1f5ed;border:1px solid #e0e8dc;border-radius:14px}.recipe-search{display:flex;align-items:center;gap:.65rem;min-width:0;padding:.1rem .85rem;border:1px solid #d5e0d2;border-radius:9px;background:#fff}.recipe-search svg{width:20px;height:20px;flex:none;fill:none;stroke:#688269;stroke-width:1.8;stroke-linecap:round}.recipe-search input{width:100%;min-width:0;min-height:42px;border:0;background:transparent;font:inherit;font-size:1rem;outline:none;color:#2d4333}.recipe-search input:focus-visible{outline:2px solid #789777;outline-offset:2px}.recipe-search input::-webkit-search-cancel-button{cursor:pointer}.recipe-filter-label{display:flex;align-items:center;gap:.6rem;min-width:0;color:#738173;font-size:.9rem}.recipe-filter-label>span{flex:none}.recipe-filter-label select{min-width:0;flex:1;padding:.7rem .8rem;border:1px solid #d5e0d2;border-radius:9px;background:#fff;font:inherit;font-size:.95rem;color:#334a37}.recipe-result-count{min-height:1.3rem;margin:.55rem .2rem;color:#829082;font-size:.9rem}.recipe-category-tag{display:inline-flex;align-items:center;padding:.33rem .6rem;border-radius:999px;background:#e9f0e5;color:#56765a;font-size:.78rem;font-weight:700;letter-spacing:.02em}.recipe-card>div .recipe-category-tag{margin-bottom:.55rem}.recipe-no-results{padding:1rem;text-align:center;color:#768274}.recipe-no-results[hidden]{display:none}.recipe-form-section{display:grid;gap:.65rem;padding:1rem;background:#f6f8f3;border:1px solid #e3e9df;border-radius:12px}.recipe-form-heading h3{margin:0;color:#35503a;font-size:1.05rem}.recipe-form-heading p{margin:.25rem 0 0;color:#748273;font-size:.9rem;font-weight:400}.recipe-line-list{display:grid;gap:.55rem}.recipe-line{display:grid;grid-template-columns:32px minmax(0,1fr) 40px;gap:.55rem;align-items:center}.recipe-line-number{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#e6eee2;color:#58775b;font-size:.9rem;font-weight:700}.recipe-line input,.recipe-line textarea{box-sizing:border-box;width:100%;min-width:0;margin:0!important;padding:.65rem .75rem;border:1px solid #d0dbcd;border-radius:8px;background:white;color:#293e2e;font:inherit;font-size:.95rem;resize:vertical}.recipe-remove-line{width:38px;height:38px;border:1px solid #e0e6dc;border-radius:9px;background:white;color:#7a897b;font:inherit;font-size:1.35rem;cursor:pointer}.recipe-remove-line:hover{border-color:#d3ada5;background:#fbf4f2;color:#a55f50}.recipe-add-line{justify-self:start;padding:.55rem .75rem;border:1px dashed #aebfaa;border-radius:8px;background:transparent;color:#557557;font:inherit;font-size:.95rem;font-weight:700;cursor:pointer}.recipe-add-line:hover{background:#eaf1e6}.recipe-detail .recipe-display-section{margin:1.1rem 0;padding:1rem;background:#f5f7f1;border:1px solid #e4e9df;border-radius:12px}.recipe-display-section h3{margin:.1rem 0 .5rem;color:#35503a}.recipe-display-section ul,.recipe-display-section ol{margin:.3rem 0;padding-left:1.5rem}.recipe-display-section li{padding:.22rem 0}.recipe-detail>.recipe-category-tag{margin-top:.3rem}.recipe-grid [data-recipe-card][hidden]{display:none}
@media(max-width:620px){.recipe-toolbar{grid-template-columns:1fr;padding:.8rem}.recipe-filter-label{align-items:stretch;flex-direction:column;gap:.25rem}.recipe-filter-label select{width:100%}.recipe-line{grid-template-columns:28px minmax(0,1fr) 36px;gap:.4rem}.recipe-line-number{width:26px;height:26px;font-size:.82rem}.recipe-remove-line{width:36px;height:36px}}
