@layer sections {
/* ── Groceries ─────────────────────────────────────────── */
.groceries-screen { flex: 1; display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.groceries-scroll { flex: 1; padding: 24px 28px 96px; overflow-y: auto; }

.grocery-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--surface);
  background: var(--text);
  border: none;
  cursor: pointer;
  z-index: 240;
  box-shadow: 0 4px 16px oklch(18% 0.015 65 / 0.28);
}
.grocery-fab:hover { opacity: 0.9; }

.grocery-empty-add { margin-top: 4px; }
@media (max-width: 700px) { .grocery-empty-add { display: none; } }

.grocery-quick-add-form { display: flex; gap: 8px; align-items: center; }
.grocery-quick-add-input { flex: 1 1 auto; min-width: 0; }

.grocery-form { display: flex; flex-direction: column; gap: 10px; }
.grocery-form-row { display: flex; gap: 8px; align-items: center; }
.grocery-name { flex: 1 1 auto; min-width: 0; }
.grocery-qty { flex: 0 0 84px; }
.grocery-submit { width: 100%; }

@media (min-width: 701px) {
  .grocery-fab { display: none; }
}

@media (max-width: 700px) {
  .grocery-quick-add { display: none; }
  .grocery-fab { right: 16px; bottom: calc(62px + env(safe-area-inset-bottom) + 16px); }
  .groceries-scroll { padding-left: 16px; padding-right: 16px; }
}

.grocery-list { display: flex; flex-direction: column; gap: 20px; max-width: 680px; margin: 0 auto; }
.grocery-aisle { display: flex; flex-direction: column; }
.grocery-item { display: flex; align-items: center; gap: 6px; }
.grocery-item .check-row { flex: 1; text-decoration: none; padding: 6px 0; border-bottom: none; }
.grocery-edit {
  display: flex;
  padding: 6px;
  border: none;
  background: none;
  color: var(--faint);
  cursor: pointer;
}
.grocery-edit:hover { color: var(--text); }
.grocery-delete-form { display: contents; }
.grocery-delete {
  display: flex;
  padding: 6px;
  border: none;
  background: none;
  color: var(--faint);
  cursor: pointer;
}
.grocery-delete:hover { color: var(--text); }

.grocery-complete-all { width: 100%; justify-content: center; height: 44px; margin-top: 8px; }

@media (max-width: 700px) {
  .grocery-complete-all {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(62px + env(safe-area-inset-bottom) + 16px);
    width: auto;
    margin-top: 0;
    padding: 0 24px;
    z-index: 240;
    box-shadow: 0 4px 16px oklch(18% 0.015 65 / 0.28);
  }
}

.grocery-completed { margin-top: 8px; }
.grocery-qty-badge { color: var(--faint); font-size: 14px; margin-left: 4px; }
}
