/*
 * Meals: the saved meals as entry rows, searchable once there are a few,
 * and the meal form.
 */
@layer components {
  .meal-library__search { margin-bottom: var(--space-3); }

  /* A section heading with its controls on the same line. */
  .section-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    margin-bottom: var(--space-3);
  }
  .section-bar h2 { font-size: var(--text-xl); }

  /* Two or three choices, one current: a pill split in parts. */
  .segmented {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
  }
  .segmented__option {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-pill);
    color: var(--muted);
    font-size: var(--text-sm);
    font-weight: 800;
    text-decoration: none;
  }
  .segmented__option:hover { color: var(--ink); }
  .segmented__option[aria-current="page"] { background: var(--leaf); color: var(--cream); }

  .entry-list__empty {
    padding: var(--space-5);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    color: var(--muted);
    font-weight: 600;
    text-align: center;
  }
  .entry-list__note { margin: var(--space-3) var(--space-2) 0; color: var(--muted); font-size: var(--text-sm); font-weight: 600; }

  a.entry__summary { color: inherit; text-decoration: none; }

  .input--number { max-width: 7rem; }
  .inline-form__row .input--number { flex: 0 0 7rem; }
  .input--area { min-height: 0; padding-block: var(--space-3); border-radius: var(--radius-md); resize: vertical; }

  /* The meal form's ingredient lines: amount, name, remove. */
  .ingredients { min-width: 0; margin: 0; padding: 0; border: 0; }
  .ingredients__list { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
  .ingredient-row { position: relative; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); }
  .ingredient-row[hidden] { display: none; }
  .ingredient-row__error { grid-column: 1 / -1; }
  .ingredient-row__new-item { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: 800; cursor: pointer; }
  .ingredient-row__new-item input { width: 20px; height: 20px; accent-color: var(--leaf); }
  .ingredient-row__remove {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
  }
  .ingredient-row__remove:hover { background: var(--danger-soft); color: var(--ink); }
  .ingredients .button--quiet svg { width: 18px; height: 18px; }

  /* A checkbox with a label and a hint beside it. */
  .check-field { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; }
  .check-field__box { flex: none; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--leaf); }
  .check-field__label { display: block; font-size: var(--text-sm); font-weight: 800; }

  .meal-delete { margin-top: var(--space-4); }
}
