/* Meals module v1: Meal planner, recipe card, shopping list (theme variables only). */
.ml-week { margin: 2px 0 8px; }
.ml-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 12px; }
.ml-day { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; padding: 6px 0; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 12px; }
.ml-day b { font-size: 16px; color: var(--text); }
.ml-day.today { border-color: var(--accent-2); }
.ml-day.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ml-day.on b { color: #fff; }
.ml-summary { margin-bottom: 10px; }
.ml-sum-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ml-sum-head .h-sm { margin: 2px 0 6px; }
.ml-waiting { margin: 6px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2, var(--bg-elev)); border: 1px dashed var(--line); font-weight: 600; }
.ml-macros { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0; }
.ml-macro { background: var(--surface-2, var(--bg-elev)); border-radius: 12px; padding: 8px 10px; }
.ml-macro-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 13px; }
.ml-macro-top b { font-size: 15px; }
.ml-bar { height: 6px; border-radius: 99px; background: var(--line); margin-top: 6px; overflow: hidden; }
.ml-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.ml-cook { margin: 4px 2px 8px; }
.ml-meals { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ml-meal { display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; overflow: hidden; padding: 0 0 12px; }
.ml-meal-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2, var(--bg-elev)); }
.ml-meal-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 14px 0; width: 100%; box-sizing: border-box; }
.ml-meal.kids { opacity: 0.8; }
.ml-meal-type { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-2); }
.ml-meal-title { font-size: 16px; font-weight: 700; }
.ml-meal-mac { font-size: 13px; }
.ml-chip { font-size: 12px; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.ml-chip.kids { border-style: dashed; }
.ml-est { font-style: normal; font-size: 11px; font-weight: 700; margin-left: 4px; padding: 1px 6px; border-radius: 99px; border: 1px solid var(--warn, #f5c542); color: var(--warn, #f5c542); }
.ml-import { margin-top: 12px; }
.ml-import summary, .card > summary { font-weight: 700; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.ml-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ml-row .btn { flex: 1 1 140px; min-height: 44px; }
.ml-errs { margin: 6px 0 0 18px; padding: 0; word-break: break-word; }
/* recipe */
.ml-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; margin-bottom: 10px; background: var(--surface-2, var(--bg-elev)); display: block; }
.ml-photo-wrap { position: relative; width: 100%; display: block; }
.ml-photo-wrap .ml-meal-photo { width: 100%; }
.ml-photo-wrap-card { margin-bottom: 10px; }
.ml-photo-wrap-card .ml-img { margin-bottom: 0; }
.ml-illustration-label {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: rgba(48, 36, 24, 0.62); color: #fff;
  padding: 3px 7px; border-radius: 99px; pointer-events: none; line-height: 1.2;
}

.ml-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.ml-facts span { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; font-size: 13px; color: var(--muted); }
.ml-facts b { display: block; font-size: 17px; color: var(--text); }
.ml-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ml-tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2, var(--bg-elev)); border: 1px solid var(--line); color: var(--muted); }
.ml-tag.org { color: var(--accent-2); border-color: var(--accent-2); }
.ml-macro-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 6px 0; }
.ml-macro-grid b { display: block; font-size: 16px; }
.ml-macro-grid span { font-size: 12px; color: var(--muted); }
.ml-ing { margin: 6px 0 10px; padding-left: 18px; }
.ml-ing li { margin: 6px 0; }
.ml-ing.kids li { color: var(--muted); }
.ml-ingnote { display: block; }
.ml-qty { font-weight: 700; }
.ml-method { margin: 6px 0; padding-left: 22px; }
.ml-method li { margin: 8px 0; line-height: 1.45; }
#recipe-body .card { margin-bottom: 10px; }
/* shopping list */
.sl-total, .sl-store { margin-bottom: 12px; }
.sl-store-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sl-store-head .h-sm { margin: 0; }
.sl-web { color: var(--accent-2); font-weight: 700; text-decoration: none; font-size: 14px; padding: 8px 0 8px 8px; }
.sl-aisle { margin: 12px 0 4px; font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.sl-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.sl-item input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); }
.sl-main { display: flex; flex-direction: column; min-width: 0; }
.sl-name { font-weight: 600; word-break: break-word; }
.sl-note { display: block; margin-top: 2px; word-break: break-word; }
.sl-item.on .sl-name { text-decoration: line-through; opacity: 0.6; }
.sl-pantry { color: var(--warn, #f5c542); }
.sl-sub-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }

/* Cards on the Meals, Recipe and Shopping screens (the app theme has no shared .card class). */
#screen-meals .card, #screen-recipe .card, #screen-shoplist .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 12px; box-sizing: border-box; max-width: 100%; }
#screen-meals .ml-meals .card { margin: 0; padding: 0 0 12px; overflow: hidden; }
button.ml-meal { -webkit-appearance: none; appearance: none; background: var(--card); }
button.ml-meal.kids { background: var(--surface-2); }
button.ml-meal:active { border-color: var(--accent-2); }

/* a1-test18: tick a meal so its reminder follow-up stops */
.ml-meal-wrap { display: flex; align-items: stretch; gap: 8px; margin: 0 0 12px; }
.ml-meal-wrap .ml-meal { flex: 1; margin: 0; }
.ml-eaten { display: flex; align-items: center; justify-content: center; min-width: 48px; padding: 0 4px; }
.ml-eaten input { width: 22px; height: 22px; }
.ml-meal-wrap.is-eaten .ml-meal { opacity: .65; }

/* a1-test23: fit toggle, can't-fit swaps, gap-filler snacks */
.ml-fit { display: flex; align-items: flex-start; gap: 10px; font-weight: 700; margin: 10px 0 4px; }
.ml-fit input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.ml-fit-note { margin: 0 0 10px; }
.ml-bar.off i { background: linear-gradient(90deg, #c45c26, #e0a106); }
.ml-cantfit { margin: 12px 0 0; padding: 12px; border-radius: 12px; background: var(--surface-2, var(--bg-elev)); border: 1px solid var(--line); }
.ml-cantfit p { margin: 0 0 8px; }
.ml-swap-list, .ml-snack-list { margin: 0 0 8px; padding-left: 1.15em; }
.ml-swap-list li, .ml-snack-list li { margin: 0 0 6px; }
.ml-snacks { margin-top: 4px; }
.ml-fitted-note { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2, var(--bg-elev)); font-weight: 600; }
#btn-ml-targets { margin: 8px 0 10px; }


/* a1-test24: per-meal Swap (library + food needs) */
.ml-swap-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 14px 56px; }
.ml-swap-btn { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.ml-chip.warn { color: var(--danger, #b3261e); border-color: currentColor; }
.ml-swap-panel { margin: -6px 0 16px; padding: 14px; }
.ml-swap-panel .su-label { margin: 4px 0 6px; }
.ml-swap-opts { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ml-swap-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; min-height: 48px; padding: 10px 12px; text-align: left; font: inherit; color: var(--text); background: var(--surface-2, var(--bg-elev)); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; -webkit-appearance: none; appearance: none; }
.ml-swap-opt:active { border-color: var(--accent-2); }
.ml-swap-fit { font-size: 13px; font-weight: 700; }
.ml-swap-fit.ok { color: var(--accent-2); }
.ml-swap-fit.no { color: var(--muted); }
.ml-swap-close summary { cursor: pointer; font-weight: 600; margin: 4px 0 8px; min-height: 32px; }
.ml-swap-empty { margin: 8px 0 12px; font-weight: 600; }
.ml-swap-more, #b12-swap-panel .b12-swap-more { display: block; width: 100%; min-height: 44px; margin: 0 0 10px; }
.ml-diet { margin: 6px 0 10px; }
.ml-diet p { margin: 0 0 4px; }
.sl-unpriced summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.pinterest-row { margin: 12px 0 4px; }
.pinterest-row a.pinterest-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-2); font-weight: 700; text-decoration: none; font-size: 15px; }
