/*
 * Plans: the open list's name and its List | Plan switch, what was added
 * to it (entry rows, as on Meals and Regulars), and the pickers for adding
 * saved meals and regulars.
 */
@layer components {
  .plan-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    margin-bottom: var(--space-4);
  }
  .plan-bar__name { min-width: 0; }
  .plan-bar__name summary { display: flex; align-items: center; gap: var(--space-2); list-style: none; cursor: pointer; }
  .plan-bar__name summary::-webkit-details-marker { display: none; }
  .plan-bar__name h2 { font-size: var(--text-xl); }
  .plan-bar__rename { display: inline-grid; color: var(--muted); }
  .plan-bar__rename svg { width: 16px; height: 16px; }
  .plan-bar__name[open] .inline-form { margin-top: var(--space-3); }
  .plan-bar .count { min-width: 20px; height: 20px; margin-left: var(--space-1); font-size: var(--text-xs); color: var(--ink); }

  .add-bigger { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-3); }
  .add-bigger svg { width: 18px; height: 18px; }

  .plan-view { display: grid; gap: var(--space-4); }
  .plan-view .entry-list { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
  .plan-direct__items { display: grid; gap: var(--space-1); margin: 0; padding: var(--space-3) var(--space-4); list-style: none;
    border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); font-weight: 700; }
  .plan-fixed { display: grid; gap: var(--space-1); list-style: none; font-weight: 700; }
  .list-actions--end { justify-content: flex-end; margin-top: var(--space-5); }
  .ingredient-row__via { margin: calc(-1 * var(--space-1)) 0 var(--space-2); }

  /* Picking meals or regulars: a tick, the name, and this list's amount. */
  .picker { display: grid; gap: var(--space-4); }
  .picker__list { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
  .picker__row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); }
  .picker__row + .picker__row { border-top: 1px solid var(--line); }
  .picker__row[hidden] { display: none; }
  .picker__row:has(.picker__error) { flex-wrap: wrap; }
  .picker__error { flex-basis: 100%; margin: 0; }
  .picker__choice { display: flex; flex: 1; align-items: center; gap: var(--space-3); min-width: 0; min-height: var(--touch); cursor: pointer; }
  .picker__choice .check-field__box { margin-top: 0; }
  .picker__amount-label { color: var(--muted); font-size: var(--text-xs); font-weight: 800; }
  .picker__amount { width: 7rem; }
  .picker__servings { display: flex; flex: none; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--text-sm); font-weight: 800; }
  .picker__servings-input { width: 4.25rem; text-align: center; }
  .picker__actions { position: sticky; bottom: calc(max(var(--space-3), env(safe-area-inset-bottom)) + 76px); }
  @media (min-width: 768px) { .picker__actions { position: static; } }
  @media (max-width: 479px) { .picker__amount-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
}
