.grocery-page .grocery-panel,
.grocery-page .grocery-meals {
  margin-block: 1rem;
}

.grocery-page .grocery-panel {
  background: var(--sagewash);
}

.grocery-starters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1rem;
  padding-block: 1rem;
}

.grocery-starters > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.grocery-starters h2 {
  font-size: 1.15rem;
  margin: 0;
}

.grocery-starters .button {
  margin-top: auto;
}

.grocery-page label {
  font-weight: 600;
}

.grocery-page textarea {
  display: block;
  width: 100%;
  min-height: 6rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  resize: vertical;
}

.grocery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-block: .85rem;
}

.grocery-actions .button,
.grocery-starters .button {
  min-height: 44px;
}

.grocery-page .grocery-note,
.grocery-page .grocery-status {
  font-size: .95rem;
}

.grocery-status:empty {
  margin: 0;
}

.grocery-items {
  list-style: none;
  padding: 0;
}

.grocery-items li {
  display: flex;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid var(--line);
}

.grocery-items label {
  min-width: 0;
  min-height: 44px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: .6rem;
  overflow-wrap: anywhere;
}

.grocery-items input {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  accent-color: var(--sage);
}

.grocery-items input:checked + span {
  text-decoration: line-through;
}

.grocery-items button {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  color: inherit;
  background: transparent;
  text-decoration: underline;
}

.grocery-page [hidden] {
  display: none;
}

.grocery-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.grocery-fields > label { min-width: 0; }
.grocery-fields :is(input:not([type="checkbox"]), select) {
  display: block; width: 100%; min-height: 48px; margin-top: 4px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit;
}
.grocery-page label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.grocery-page :is(.button, summary, select) { min-height: 48px; }
.grocery-page .grocery-fields, .grocery-page .grocery-actions { margin-block: 8px 12px; }
.grocery-starters { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.grocery-starters details { padding: 12px 15px; border: 1px solid var(--line); border-radius: 19px; background: var(--sagewash); }
.grocery-starters details:nth-child(3n + 2) { background: var(--blush); }
.grocery-starters details:nth-child(3n) { background: var(--honey); }
.grocery-starters summary, .grocery-editor summary { cursor: pointer; font-weight: 650; padding: 8px 5px; }
.grocery-starters details .button { margin-top: 7px; }
#grocery-items h3 { font-size: 1.04rem; }
#grocery-items section + section { margin-top: 10px; }
.grocery-items li { position: relative; gap: 8px; }
.grocery-editor[open] { grid-column: 1 / -1; width: 100%; }
.grocery-items li:has(.grocery-editor[open]) { display: grid; grid-template-columns: 1fr; }
.grocery-picker-label, .grocery-picked > label { opacity: .75; }
.grocery-picked > label { text-decoration: line-through; }
.grocery-region { margin-block: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#grocery-totals, #grocery-offers li { margin-top: 12px; }
#grocery-totals p, #grocery-offers p { margin-block: 4px; }
#grocery-offers .button { margin-inline-end: 8px; }
@media (max-width: 520px) { .grocery-fields { grid-template-columns: 1fr; } }

#grocery-meal-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: max(1rem, 16px);
}
#grocery-meal-picks {
  min-width: 0;
  margin-block: 12px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}
#grocery-meal-picks legend { font-weight: 650; }
#grocery-meal-picks label + label { border-top: 1px solid var(--line); }
#grocery-meal-picks input { width: 1.1rem; height: 1.1rem; accent-color: var(--sage); }
#list-title { scroll-margin-top: calc(var(--site-header-height, 72px) + 12px); }
